MPI_Intercomm_create (temp, 0, MPI_COMM_WORLD, rleader,
INTERCOMM_CREATE_TAG, &intercomm);
MPI_Comm_free (&temp);
-
+
if (intercomm != MPI_COMM_NULL) {
/* need to make a different split communicator temporarily... */
- MPI_Comm_split (MPI_COMM_WORLD,
+ MPI_Comm_split (MPI_COMM_WORLD,
rank < nprocs/2, nprocs - rank, &temp);
if (temp != MPI_COMM_NULL) {
MPI_Intercomm_create (temp, 0, MPI_COMM_WORLD, rleader,
INTERCOMM_CREATE_TAG, &intercomm2);
MPI_Comm_free (&temp);
-
+
if (intercomm2 != MPI_COMM_NULL) {
if (rank < nprocs/2) {
MPI_Intercomm_merge (intercomm2, rank < nprocs/2, &comm2);
memset (buf0, 0, buf_size);
MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm);
-
+
MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm, &status);
}
}
memset (buf0, 0, buf_size);
MPI_Send (buf0, buf_size, MPI_INT, 1, 0, comm2);
-
+
MPI_Recv (buf1, buf_size, MPI_INT, 1, 0, comm2, &status);
}
}