- refcount_ = 1;
- topoType_ = MPI_INVALID_TOPO;
- intra_comm_ = MPI_COMM_NULL;
- leaders_comm_ = MPI_COMM_NULL;
- is_uniform_ = 1;
- non_uniform_map_ = nullptr;
- leaders_map_ = nullptr;
- is_blocked_ = 0;
- info_ = MPI_INFO_NULL;
+ errhandler_->ref();
+ //First creation of comm is done before SIMIX_run, so only do comms for others
+ if(in_id==MPI_UNDEFINED && smp==0 && this->rank()!=MPI_UNDEFINED ){
+ this->add_f();
+ group->add_f();
+ int id;
+ if(this->rank()==0){
+ static int global_id_ = 0;
+ id=global_id_;
+ global_id_++;
+ }
+ colls::bcast(&id, 1, MPI_INT, 0, this);
+ XBT_DEBUG("Communicator %p has id %d", this, id);
+ id_=id;//only set here, as we don't want to change it in the middle of the bcast
+ colls::barrier(this);
+ }