@@ -97,10 +97,14 @@ module parmetis_interface
97
97
! end interface
98
98
99
99
100
+ ! This is a bit of a hack, but it is necessary to invoke the Fortran
101
+ ! API entry point for ParMETIS so that MPI handles are converted
102
+ ! properly. Hence, use the C symbol name parmetis_v3_partmeshkway
103
+ ! (not the C ParMETIS API entry point ParMETIS_V3_PartMeshKway).
100
104
interface
101
105
integer (C_INT) function ParMETIS_V3_PartMeshKway(elmdist,eptr,eind,&
102
106
elmwgt,wgtflag,numflag,ncon,ncommonnodes,nparts,tpwgts,ubvec,&
103
- opts,edgecut,part,comm) bind(C,name= " ParMETIS_V3_PartMeshKway " )
107
+ opts,edgecut,part,comm) bind(C,name= " parmetis_v3_partmeshkway " )
104
108
use , intrinsic :: ISO_C_BINDING
105
109
implicit none
106
110
integer (C_INT) :: wgtflag,numflag,ncon,comm,&
@@ -166,13 +170,16 @@ end function ParMETIS_V3_PartMeshKway
166
170
! end interface
167
171
168
172
173
+ ! Similar to above, be sure to use the Fortran API entry point for
174
+ ! ParMETIS, not the C API entry point.
169
175
interface
170
176
integer (C_int64_t) function ParMETIS_V3_PartKway(vtxdist,xadj,adjncy,&
171
177
vwgt,adjwgt,wgtflag,numflag,ncon,nparts,tpwgts,ubvec,&
172
- opts,edgecut,part,comm) bind(C,name= " ParMETIS_V3_PartKway " )
178
+ opts,edgecut,part,comm) bind(C,name= " parmetis_v3_partkway " )
173
179
use , intrinsic :: ISO_C_BINDING
174
180
implicit none
175
- integer (C_int64_t) :: wgtflag,numflag,ncon,comm,&
181
+ integer (C_INT) :: comm
182
+ integer (C_int64_t) :: wgtflag,numflag,ncon,&
176
183
nparts,edgecut
177
184
integer (C_int64_t), dimension (* ) :: vtxdist,xadj,adjncy,vwgt
178
185
type (C_PTR), value :: adjwgt
0 commit comments