Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,16 @@ static void comm_init_check_(struct comm *c, MPI_Fint ce, uint np,
}
#define comm_init_check(c,ce,np) comm_init_check_(c,ce,np,__FILE__,__LINE__)

#define GS_UNUSED(x) (void)(x)

static void comm_dup_(struct comm *d, const struct comm *s,
const char *file, unsigned line)
{
d->id = s->id, d->np = s->np;
#ifdef GSLIB_USE_MPI
MPI_Comm_dup(s->c,&d->c);
GS_UNUSED(file);
GS_UNUSED(line);
#else
if(s->np!=1) fail(1,file,line,"%s not compiled with -DMPI\n",file);
#endif
Expand All @@ -189,12 +192,16 @@ static void comm_split_(const struct comm *s, int bin, int key, struct comm *d,
MPI_Comm_split(s->c, bin, key, &nc);
comm_init(d, nc);
MPI_Comm_free(&nc);
GS_UNUSED(file);
GS_UNUSED(line);
#else
if(s->np!=1) fail(1,file,line,"%s not compiled with -DMPI\n",file);
#endif
}
#define comm_split(s, bin, key, d) comm_split_(s, bin, key, d, __FILE__, __LINE__)

#undef GS_UNUSED

static void comm_free(struct comm *c)
{
#ifdef GSLIB_USE_MPI
Expand Down