Commit 9ef272bd authored by Dave Moxey's avatar Dave Moxey
Browse files

Re-enabling AS_METIS_NodeND call, removing older version and wrapper to NodeND.

Updated FindMetis cmake file to reflect new library.
parent b1816f84
SET(METIS_SEARCH_PATHS
${CMAKE_SOURCE_DIR}/ThirdParty/modmetis-4.0/
${CMAKE_SOURCE_DIR}/ThirdParty/modmetis-4.0/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/modmetis-4.0/
${CMAKE_SOURCE_DIR}/../ThirdParty/modmetis-4.0/build
${CMAKE_SOURCE_DIR}/ThirdParty/metis-5.0.2/
${CMAKE_SOURCE_DIR}/ThirdParty/metis-5.0.2/build/
${CMAKE_SOURCE_DIR}/../ThirdParty/metis-5.0.2/
${CMAKE_SOURCE_DIR}/../ThirdParty/metis-5.0.2/build
${CMAKE_SOURCE_DIR}/ThirdParty/dist/lib
${CMAKE_SOURCE_DIR}/../ThirdParty/dist/lib)
FIND_LIBRARY(METIS_LIB NAMES modmetis PATHS ${METIS_SEARCH_PATHS})
FIND_LIBRARY(METIS_LIB NAMES metis PATHS ${METIS_SEARCH_PATHS})
SET(METIS_FOUND FALSE)
IF (METIS_LIB)
SET(METIS_FOUND TRUE)
GET_FILENAME_COMPONENT(METIS_PATH ${METIS_LIB} PATH)
INCLUDE_DIRECTORIES(${METIS_PATH}/../include)
MARK_AS_ADVANCED(METIS_PATH)
MARK_AS_ADVANCED(METIS_LIB)
ENDIF (METIS_LIB)
......
......@@ -45,57 +45,25 @@ namespace Metis
{
extern "C"
{
/* // -- Sparse MAtrix Reordering (equivalent to onmetis)
void METIS_NodeND (int *nVerts, int *xadj, int *adjncy, int *numflag, int *options,
int *perm, int *iperm);
void AS_METIS_NodeND(int *nVerts, int *xadj, int *adjncy, int *numflag, int *options,
void AS_METIS_NodeND(int *nVerts, int *xadj, int *adjncy, int *vwgt, int *options,
int *perm, int *iperm, int *map, int *mdswitch);
void METIS_PartMeshNodal(int *nElmts, int *nVerts, int *elType, int *numflag,
int *nparts, int *edgecut, int *epart, int *npart);
void METIS_PartGraphVKway(int *nVerts, int *xadj, int *adjcy, int *vertWgt, int *vertSize,
int *wgtFlag, int *numflag, int *nparts, int *options, int *volume, int *part);
*/ }
inline static void onmetis(int *nVerts, int *xadj, int *adjncy, int *numflag, int *options,
int *perm, int *iperm)
{
METIS_NodeND(nVerts,xadj,adjncy,numflag,options,perm,iperm);
}
inline static void as_onmetis(int *nVerts, int *xadj, int *adjncy, int *numflag, int *options,
int *perm, int *iperm, int *map, int *mdswitch)
{
// AS_METIS_NodeND(nVerts,xadj,adjncy,numflag,options,perm,iperm,map,mdswitch) ;
}
inline static void onmetis(int nVerts, Nektar::Array<Nektar::OneD, int> xadj, Nektar::Array<Nektar::OneD, int> adjncy,
Nektar::Array<Nektar::OneD, int> perm, Nektar::Array<Nektar::OneD, int> iperm)
inline static void as_onmetis(
int nVerts,
Nektar::Array<Nektar::OneD, int> xadj,
Nektar::Array<Nektar::OneD, int> adjncy,
Nektar::Array<Nektar::OneD, int> perm,
Nektar::Array<Nektar::OneD, int> iperm,
Nektar::Array<Nektar::OneD, int> map,
int mdswitch = 1)
{
ASSERTL1(xadj.num_elements() == nVerts+1,"Array xadj out of bounds");
ASSERTL1(perm.num_elements() == nVerts,"Array perm out of bounds");
ASSERTL1(iperm.num_elements() == nVerts,"Array iperm out of bounds");
int numflag = 0;
int options[8];
options[0]=0;
METIS_NodeND(&nVerts,&xadj[0],&adjncy[0],&numflag,options,&perm[0],&iperm[0]);
}
inline static void as_onmetis(int nVerts, Nektar::Array<Nektar::OneD, int> xadj, Nektar::Array<Nektar::OneD, int> adjncy,
Nektar::Array<Nektar::OneD, int> perm, Nektar::Array<Nektar::OneD, int> iperm, Nektar::Array<Nektar::OneD, int> map,
int mdswitch)
{
// ASSERTL1(xadj.num_elements() == nVerts+1,"Array xadj out of bounds");
// ASSERTL1(perm.num_elements() == nVerts,"Array perm out of bounds");
// ASSERTL1(iperm.num_elements() == nVerts,"Array iperm out of bounds");
//
// int numflag = 0;
// int options[8];
// options[0]=0;
// AS_METIS_NodeND(&nVerts,&xadj[0],&adjncy[0],&numflag,options,&perm[0],&iperm[0],&map[0],&mdswitch);
AS_METIS_NodeND(&nVerts, &xadj[0], &adjncy[0], NULL, NULL, &perm[0],
&iperm[0], &map[0], &mdswitch);
}
// inline static void MeshPartition(int nElmts, int nVerts, Nektar::Array<Nektar::OneD, int>& mesh, int type, int nparts,
......
......@@ -549,7 +549,7 @@ namespace Nektar
BottomUpSubStructuredGraphSharedPtr &bottomUpGraph,
set<int> &extraDirVerts,
const bool checkIfSystemSingular,
int mdswitch,
int mdswitch,
bool doInteriorMap)
{
int i,j,k,l,m;
......@@ -1204,7 +1204,7 @@ namespace Nektar
case eIterativeMultiLevelStaticCond:
case eXxtMultiLevelStaticCond:
{
MultiLevelBisectionReordering(boostGraphObj,perm,iperm,bottomUpGraph,mdswitch,partVerts);
MultiLevelBisectionReordering(boostGraphObj,perm,iperm,bottomUpGraph,partVerts,mdswitch);
}
break;
default:
......
......@@ -1108,8 +1108,7 @@ namespace Nektar
case eIterativeMultiLevelStaticCond:
case eXxtMultiLevelStaticCond:
{
int mdswitch = 1;
MultiLevelBisectionReordering(boostGraphObj,perm,iperm,bottomUpGraph,mdswitch,partVerts);
MultiLevelBisectionReordering(boostGraphObj,perm,iperm,bottomUpGraph,partVerts);
}
break;
default:
......
......@@ -864,8 +864,8 @@ namespace Nektar
Array<OneD, int> &perm,
Array<OneD, int> &iperm,
BottomUpSubStructuredGraphSharedPtr &substructgraph,
const int mdswitch,
std::set<int> partVerts)
std::set<int> partVerts,
int mdswitch)
{
int nGraphVerts = boost::num_vertices(graph);
int nGraphEdges = boost::num_edges (graph);
......@@ -993,7 +993,7 @@ namespace Nektar
{
Metis::as_onmetis(
nNonPartition,xadj,adjncy,perm_tmp,iperm_tmp,
septreeTmp,mdswitch);
septreeTmp, mdswitch);
}
catch(...)
{
......
......@@ -262,8 +262,8 @@ namespace Nektar
Array<OneD, int> &perm,
Array<OneD, int> &iperm,
BottomUpSubStructuredGraphSharedPtr &substructgraph,
const int mdswitch = 1,
std::set<int> partVerts = std::set<int>());
std::set<int> partVerts = std::set<int>(),
int mdswitch = 1);
// The parameter MDSWITCH.
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment