Skip to content

Commit

Permalink
Use MPI_Comm_split instead of GenmapCommSplit
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Feb 13, 2019
1 parent c64a9a2 commit 68ebc46
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/parRSB.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ void fparRSB_partMesh(int *part, long long *vtx, int *nel, int *nve,

int parRSB_partMesh(int *part, long long *vtx, int nel, int nve, int *options,
MPI_Comm comm) {
int bin = nel > 0;
int id;
MPI_Comm newComm;
MPI_Comm_rank(comm, &id);
MPI_Comm_split(comm, bin, id, &newComm);

GenmapHandle h;
GenmapInit(&h, comm);
GenmapInit(&h, newComm);

double time0 = comm_time();

Expand All @@ -33,11 +39,6 @@ int parRSB_partMesh(int *part, long long *vtx, int nel, int nve, int *options,
h->printStat = options[2];
}

// Assert that nel is greater then zero. Will be removed in future.
int bin = nel > 0;
GenmapComm global = GenmapGetGlobalComm(h);
GenmapSplitComm(h, &global, bin);

if(bin > 0) {
GenmapSetNLocalElements(h, (GenmapInt)nel);
GenmapScan(h, GenmapGetGlobalComm(h));
Expand Down

0 comments on commit 68ebc46

Please sign in to comment.