X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8787f75c9d14a09fa99c40380a579b2b8372b40a..bff077b4621c68455a86e60292cb0bf872a879d5:/src/smpi/smpi_base.c?ds=sidebyside diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 797e2428ac..c119790d33 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -43,6 +43,16 @@ void smpi_mpi_init() int i; smpi_host_data_t hdata; + /* Connect our log channels: that must be done manually under windows */ + /* (should be done only once, not for each process) */ + XBT_LOG_CONNECT(smpi_base, smpi); + XBT_LOG_CONNECT(smpi_bench, smpi); + XBT_LOG_CONNECT(smpi_kernel, smpi); + XBT_LOG_CONNECT(smpi_mpi, smpi); + XBT_LOG_CONNECT(smpi_receiver, smpi); + XBT_LOG_CONNECT(smpi_sender, smpi); + XBT_LOG_CONNECT(smpi_util, smpi); + SIMIX_mutex_lock(smpi_global->running_hosts_count_mutex); smpi_global->running_hosts_count++; SIMIX_mutex_unlock(smpi_global->running_hosts_count_mutex); @@ -176,7 +186,10 @@ int smpi_mpi_barrier(smpi_mpi_communicator_t comm) { SIMIX_mutex_lock(comm->barrier_mutex); - if (++comm->barrier_count >= comm->size) { + ++comm->barrier_count; + if (comm->barrier_count > comm->size) { // only happens on second barrier... + comm->barrier_count = 0; + } else if (comm->barrier_count == comm->size) { SIMIX_cond_broadcast(comm->barrier_cond); } while (comm->barrier_count < comm->size) {