From 6cd713b26cdc35133acb282e251d44307acf5a10 Mon Sep 17 00:00:00 2001 From: schnorr Date: Fri, 5 Nov 2010 09:40:38 +0000 Subject: [PATCH] new configuration option tracing/smpi/group details: - by default, it is set to 0 - if is 0, the behavior of each MPI process (in the interface level: MPI_Send, Recv, ...) is not group by host (this means that you do not know where it was executed by looking only the trace) - otherwise, processes are grouped by host info: - traditional mpi-focused visualization tools usually do not group by hosts: that is the reason we are keeping the default value to 0 (not grouped) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8498 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/instr/instr_config.c | 14 ++++++++++++++ src/instr/interface.c | 6 +++++- src/instr/private.h | 1 + src/instr/smpi_instr.c | 7 ++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 684b36c5a5..8d31014c87 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -10,6 +10,7 @@ #ifdef HAVE_TRACING #define OPT_TRACING_SMPI "tracing/smpi" +#define OPT_TRACING_SMPI_GROUP "tracing/smpi/group" #define OPT_TRACING_PLATFORM "tracing/platform" #define OPT_TRACING_MSG_TASK "tracing/msg/task" #define OPT_TRACING_MSG_PROCESS "tracing/msg/process" @@ -29,6 +30,11 @@ int TRACE_smpi_is_enabled(void) return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI); } +int TRACE_smpi_is_grouped(void) +{ + return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI_GROUP); +} + int TRACE_platform_is_enabled(void) { return xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_PLATFORM); @@ -75,6 +81,14 @@ void TRACE_global_init(int *argc, char **argv) xbt_cfgelm_int, &default_tracing_smpi, 0, 1, NULL, NULL); + /* smpi grouped */ + int default_tracing_smpi_grouped = 0; + xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_SMPI_GROUP, + "Group MPI processes by host.", + xbt_cfgelm_int, &default_tracing_smpi_grouped, 0, 1, + NULL, NULL); + + /* platform */ int default_tracing_platform = 0; xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_PLATFORM, diff --git a/src/instr/interface.c b/src/instr/interface.c index 524bde43a9..bf898aabad 100644 --- a/src/instr/interface.c +++ b/src/instr/interface.c @@ -81,7 +81,11 @@ int TRACE_start() } if (IS_TRACING_SMPI) { - pajeDefineContainerType("MPI_PROCESS", "HOST", "MPI_PROCESS"); + if (TRACE_smpi_is_grouped()){ + pajeDefineContainerType("MPI_PROCESS", "HOST", "MPI_PROCESS"); + }else{ + pajeDefineContainerType("MPI_PROCESS", "PLATFORM", "MPI_PROCESS"); + } pajeDefineStateType("MPI_STATE", "MPI_PROCESS", "MPI_STATE"); pajeDefineLinkType("MPI_LINK", "0", "MPI_PROCESS", "MPI_PROCESS", "MPI_LINK"); diff --git a/src/instr/private.h b/src/instr/private.h index a093468fca..6ceeade230 100644 --- a/src/instr/private.h +++ b/src/instr/private.h @@ -168,6 +168,7 @@ void TRACE_smpi_recv(int rank, int src, int dst); /* from instr_config.c */ int TRACE_is_configured(void); int TRACE_smpi_is_enabled(void); +int TRACE_smpi_is_grouped(void); int TRACE_platform_is_enabled(void); int TRACE_msg_task_is_enabled(void); int TRACE_msg_process_is_enabled(void); diff --git a/src/instr/smpi_instr.c b/src/instr/smpi_instr.c index 4eac5a005b..e02385fa2b 100644 --- a/src/instr/smpi_instr.c +++ b/src/instr/smpi_instr.c @@ -77,8 +77,13 @@ void TRACE_smpi_init(int rank) char str[INSTR_DEFAULT_STR_SIZE]; TRACE_smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); - pajeCreateContainer(SIMIX_get_clock(), str, "MPI_PROCESS", + if (TRACE_smpi_is_grouped()){ + pajeCreateContainer(SIMIX_get_clock(), str, "MPI_PROCESS", SIMIX_host_get_name(SIMIX_host_self()), str); + }else{ + pajeCreateContainer(SIMIX_get_clock(), str, "MPI_PROCESS", + "platform", str); + } } void TRACE_smpi_finalize(int rank) -- 2.20.1