Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
moved XBT_LOG_CONNECT calls into smpi_global so that they will only be called
[simgrid.git] / src / smpi / smpi_base.c
index 797e242..6ebefe4 100644 (file)
@@ -1,6 +1,13 @@
 #include "private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)");
+XBT_LOG_EXTERNAL_CATEGORY(smpi_base);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_bench);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_kernel);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_mpi);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_receiver);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_sender);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_util);
 
 smpi_mpi_global_t smpi_mpi_global = NULL;
 
@@ -176,7 +183,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) {