# To allow ParMETIS to play nice with newer MPI implementations, e.g., OpenMPI, # place this patch file in your top-level ParMETIS source directory and apply: # # cp kmetis.patch /path/to/ParMetis-x.y.z # cd /path/to/ParMetis-x.y.z # cp ParMETISLib/kmetis.c ParMETISLib/kmetis.c-original # OPTIONAL # patch -p0 < kmetis.patch # make # # Otherwise you will see errors like # # ... Calling ParMetis (ParMETIS_V3_PartKway) ... # forrtl: severe (174): SIGSEGV, segmentation fault occurred # # during parallel grid partitioning. # --- ParMETISLib/kmetis.c-original 2008-09-26 19:12:34.000000000 -0400 +++ ParMETISLib/kmetis.c 2010-04-25 14:52:49.000000000 -0400 @@ -22,7 +22,7 @@ void ParMETIS_V3_PartKway(idxtype *vtxdist, idxtype *xadj, idxtype *adjncy, idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *ncon, int *nparts, float *tpwgts, float *ubvec, int *options, int *edgecut, idxtype *part, - MPI_Comm *comm) + MPI_Comm *commF) { int h, i; int nvtxs = -1, npes, mype; @@ -35,6 +35,13 @@ int iwgtflag, inumflag, incon, inparts, ioptions[10]; float *itpwgts, iubvec[MAXNCON]; + /* start fortran MPI_Comm integer to C struct translation */ + MPI_Comm comm_world; + MPI_Comm *comm; + comm_world = MPI_Comm_f2c((MPI_Fint)*commF); + comm = &comm_world; + /* end fortran MPI_Comm integer to C struct translation */ + MPI_Comm_size(*comm, &npes); MPI_Comm_rank(*comm, &mype);