+ static int global_id_=0;
+ //First creation of comm is done before SIMIX_run, so only do comms for others
+ if(id==MPI_UNDEFINED && smp==0 && this->rank()!=MPI_UNDEFINED ){
+ int id;
+ if(this->rank()==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);
+ }