/* Exchange the data between the node leaders*/
if (local_rank == 0 && (leader_comm_size > 1)) {
/*When data in each socket is different*/
- if (comm->is_uniform() != 1) {
+ if (not comm->is_uniform()) {
int *node_sizes = NULL;
int i = 0;
block_dsize = dsize * count;
/*MPICH uses SMP algorithms for all commutative ops now*/
- if(!comm->is_smp_comm()){
+ if (not comm->is_smp_comm()) {
if(comm->get_leaders_comm()==MPI_COMM_NULL){
comm->init_smp();
}
//int segsize = 0;
size_t message_size, dsize;
- if(!comm->is_smp_comm()){
+ if (not comm->is_smp_comm()) {
if(comm->get_leaders_comm()==MPI_COMM_NULL){
comm->init_smp();
}
int communicator_size=0;
size_t message_size, dsize;
- if(!comm->is_smp_comm()){
+ if (not comm->is_smp_comm()) {
if(comm->get_leaders_comm()==MPI_COMM_NULL){
comm->init_smp();
}
int is_uniform_ = 1;
int* non_uniform_map_ = nullptr; // set if smp nodes have a different number of processes allocated
int is_blocked_ = 0; // are ranks allocated on the same smp node contiguous ?
- int is_smp_comm_; // set to 0 in case this is already an intra-comm or a leader-comm to avoid recursion
+ bool is_smp_comm_ = false; // set to false in case this is already an intra-comm or a leader-comm to avoid
+ // recursion
std::list<MPI_Win> rma_wins_; // attached windows for synchronization.
std::string name_;
MPI_Info info_ = MPI_INFO_NULL;
static int keyval_id_;
Comm() = default;
- Comm(MPI_Group group, MPI_Topology topo, int smp = 0, int id=MPI_UNDEFINED);
+ Comm(MPI_Group group, MPI_Topology topo, bool smp = false, int id = MPI_UNDEFINED);
int dup(MPI_Comm* newcomm);
int dup_with_info(MPI_Info info, MPI_Comm* newcomm);
MPI_Group group();
MPI_Comm get_leaders_comm();
MPI_Comm get_intra_comm();
MPI_Comm find_intra_comm(int* leader);
- int is_uniform();
- int is_blocked();
- int is_smp_comm();
+ bool is_uniform();
+ bool is_blocked();
+ bool is_smp_comm();
MPI_Comm split(int color, int key);
void cleanup_smp();
void ref();
std::unordered_map<int, smpi_key_elem> Comm::keyvals_;
int Comm::keyval_id_=0;
-Comm::Comm(MPI_Group group, MPI_Topology topo, int smp, int in_id) : group_(group), topo_(topo),is_smp_comm_(smp), id_(in_id)
+Comm::Comm(MPI_Group group, MPI_Topology topo, bool smp, int in_id)
+ : group_(group), topo_(topo), is_smp_comm_(smp), id_(in_id)
{
errhandler_->ref();
//First creation of comm is done before SIMIX_run, so only do comms for others
else return intra_comm_;
}
-int Comm::is_uniform(){
+bool Comm::is_uniform()
+{
if (this == MPI_COMM_UNINITIALIZED)
return smpi_process()->comm_world()->is_uniform();
- return is_uniform_;
+ return is_uniform_ != 0;
}
-int Comm::is_blocked(){
+bool Comm::is_blocked()
+{
if (this == MPI_COMM_UNINITIALIZED)
return smpi_process()->comm_world()->is_blocked();
- return is_blocked_;
+ return is_blocked_ != 0;
}
-int Comm::is_smp_comm(){
+bool Comm::is_smp_comm()
+{
if (this == MPI_COMM_UNINITIALIZED)
return smpi_process()->comm_world()->is_smp_comm();
return is_smp_comm_;
break;
}
}
- if(is_uniform==0 && this->is_uniform()!=0){
+ if (is_uniform == 0 && this->is_uniform()) {
non_uniform_map_ = non_uniform_map;
}else{
xbt_free(non_uniform_map);