void smpi_comm_destroy(MPI_Comm comm)
{
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
smpi_group_unuse(comm->group);
smpi_topo_destroy(comm->topo); // there's no use count on topos
smpi_comm_unuse(comm);
MPI_Group smpi_comm_group(MPI_Comm comm)
{
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
+
return comm->group;
}
int smpi_comm_size(MPI_Comm comm)
{
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
+
return smpi_group_size(smpi_comm_group(comm));
}
int smpi_comm_rank(MPI_Comm comm)
{
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
return smpi_group_rank(smpi_comm_group(comm), smpi_process_index());
}
void smpi_comm_get_name (MPI_Comm comm, char* name, int* len)
{
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
if(comm == MPI_COMM_WORLD) {
strcpy(name, "WORLD");
*len = 5;
MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
{
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
int system_tag = 123;
int index, rank, size, i, j, count, reqs;
int* sendbuf;
}
void smpi_comm_use(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
comm->refcount++;
}
void smpi_comm_unuse(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
comm->refcount--;
if(comm->refcount==0)
xbt_free(comm);