From: markls Date: Fri, 7 Mar 2008 08:32:09 +0000 (+0000) Subject: moved XBT_LOG_CONNECT calls into smpi_global so that they will only be called X-Git-Tag: v3.3~600 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ddf200da26e5f76607a92be55c34f71b1ce6acf4?ds=sidebyside moved XBT_LOG_CONNECT calls into smpi_global so that they will only be called once per program invocation rather than once per process. Also surrounded by #ifdef so that smpi can still compile against older versions of simgrid. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5276 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 006d60afb2..6ebefe4da8 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -50,16 +50,6 @@ 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); diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index d9da58990c..a6c1f6f6a3 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -124,8 +124,19 @@ void smpi_global_init() int size = SIMIX_host_get_number(); - smpi_global = xbt_new(s_smpi_global_t, 1); + /* Connect our log channels: that must be done manually under windows */ + /* (should be done only once, not for each process) */ + #ifdef XBT_LOG_CONNECT + 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); + #endif + smpi_global = xbt_new(s_smpi_global_t, 1); // config variable smpi_global->reference_speed = SMPI_DEFAULT_SPEED;