void Comm::destroy()
{
- if (this == MPI_COMM_UNINITIALIZED)
+ if (this == MPI_COMM_UNINITIALIZED){
smpi_process_comm_world()->destroy();
+ return;
+ }
delete _topo; // there's no use count on topos
this->unuse();
}
void Comm::get_name (char* name, int* len)
{
- if (this == MPI_COMM_UNINITIALIZED)
+ if (this == MPI_COMM_UNINITIALIZED){
smpi_process_comm_world()->get_name(name, len);
+ return;
+ }
if(this == MPI_COMM_WORLD) {
strncpy(name, "WORLD",5);
*len = 5;
}
void Comm::set_leaders_comm(MPI_Comm leaders){
- if (this == MPI_COMM_UNINITIALIZED)
+ if (this == MPI_COMM_UNINITIALIZED){
smpi_process_comm_world()->set_leaders_comm(leaders);
+ return;
+ }
_leaders_comm=leaders;
}
}
void Comm::use(){
- if (this == MPI_COMM_UNINITIALIZED)
+ if (this == MPI_COMM_UNINITIALIZED){
smpi_process_comm_world()->use();
+ return;
+ }
_group->use();
_refcount++;
}
}
void Comm::unuse(){
- if (this == MPI_COMM_UNINITIALIZED)
+ if (this == MPI_COMM_UNINITIALIZED){
smpi_process_comm_world()->unuse();
+ return;
+ }
_refcount--;
_group->unuse();