Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tracing MPI_Init and MPI_Finalize (trace container creation and destruction)
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 5 Aug 2010 14:19:30 +0000 (14:19 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 5 Aug 2010 14:19:30 +0000 (14:19 +0000)
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

src/instr/interface.c
src/instr/smpi_instr.c

index 5e2e219..b496ebf 100644 (file)
@@ -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");
 
index f9056e8..0512289 100644 (file)
@@ -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