}
void smpi_comm_set_leaders_comm(MPI_Comm comm, MPI_Comm leaders){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
comm->leaders_comm=leaders;
}
void smpi_comm_set_intra_comm(MPI_Comm comm, MPI_Comm leaders){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
comm->intra_comm=leaders;
}
int* smpi_comm_get_non_uniform_map(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
return comm->non_uniform_map;
}
int* smpi_comm_get_leaders_map(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
return comm->leaders_map;
}
MPI_Comm smpi_comm_get_leaders_comm(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
return comm->leaders_comm;
}
MPI_Comm smpi_comm_get_intra_comm(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
if(comm==MPI_COMM_WORLD) return smpi_process_get_comm_intra();
else return comm->intra_comm;
}
int smpi_comm_is_uniform(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
return comm->is_uniform;
}
int smpi_comm_is_blocked(MPI_Comm comm){
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
return comm->is_blocked;
}
void smpi_comm_init_smp(MPI_Comm comm){
int leader = -1;
+
+ if (comm == MPI_COMM_UNINITIALIZED)
+ comm = smpi_process_comm_world();
+
int comm_size =smpi_comm_size(comm);
// If we are in replay - perform an ugly hack
smpi_coll_tuned_allgather_mpich(&leader, 1, MPI_INT , leaders_map, 1, MPI_INT, comm);
if(smpi_privatize_global_variables){ //we need to switch here, as the called function may silently touch global variables
- switch_data_segment(smpi_process_index());
+ smpi_switch_data_segment(smpi_process_index());
}
if(!comm->leaders_map){
smpi_coll_tuned_bcast_mpich(&(comm->is_uniform),1, MPI_INT, 0, comm_intra );
if(smpi_privatize_global_variables){ //we need to switch here, as the called function may silently touch global variables
- switch_data_segment(smpi_process_index());
+ smpi_switch_data_segment(smpi_process_index());
}
// Are the ranks blocked ? = allocated contiguously on the SMP nodes
int is_blocked=1;