From: schnorr Date: Thu, 5 Aug 2010 14:19:30 +0000 (+0000) Subject: tracing MPI_Init and MPI_Finalize (trace container creation and destruction) X-Git-Tag: v3_5~697 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1190c46b4633e1c616f35eefeb53d141b28b9631 tracing MPI_Init and MPI_Finalize (trace container creation and destruction) details: - added function to create the string that identifies a mpi_process container in the trace - processes are grouped by host git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8124 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/interface.c b/src/instr/interface.c index 5e2e2193f6..b496ebfd5b 100644 --- a/src/instr/interface.c +++ b/src/instr/interface.c @@ -75,6 +75,10 @@ int TRACE_start () pajeDefineStateType("presence", "TASK", "presence"); } + if (IS_TRACING_SMPI){ + pajeDefineContainerType ("MPI_PROCESS", "HOST", "MPI_PROCESS"); + } + /* creating the platform */ pajeCreateContainer(MSG_get_clock(), "platform", "PLATFORM", "0", "simgrid-platform"); diff --git a/src/instr/smpi_instr.c b/src/instr/smpi_instr.c index f9056e891c..05122893c5 100644 --- a/src/instr/smpi_instr.c +++ b/src/instr/smpi_instr.c @@ -8,6 +8,12 @@ #ifdef HAVE_TRACING +static char *_TRACE_smpi_container (int rank, char *container, int n) +{ + snprintf (container, n, "rank-%d", rank); + return container; +} + void TRACE_smpi_start (void) { if (IS_TRACING_SMPI){ @@ -25,15 +31,20 @@ void TRACE_smpi_end (void) void TRACE_smpi_init (int rank) { if (!IS_TRACING_SMPI) return; - //double time = SIMIX_get_clock(); - //smx_host_t host = SIMIX_host_self(); + + char str[100]; + _TRACE_smpi_container (rank, str, 100); + pajeCreateContainer (SIMIX_get_clock(), str, "MPI_PROCESS", + SIMIX_host_get_name(SIMIX_host_self()), str); } void TRACE_smpi_finalize (int rank) { if (!IS_TRACING_SMPI) return; - //double time = SIMIX_get_clock(); - //smx_host_t host = SIMIX_host_self(); + + char str[100]; + pajeDestroyContainer (SIMIX_get_clock(), "MPI_PROCESS", + _TRACE_smpi_container (rank, str, 100)); } #endif