Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] buffering all events except type hierarchy definition and create/destroy...
[simgrid.git] / src / instr / instr_smpi.c
index 84f567a..99207bb 100644 (file)
@@ -56,7 +56,10 @@ static xbt_dict_t process_category;
 
 void TRACE_internal_smpi_set_category (const char *category)
 {
-  if (!TRACE_smpi_is_enabled()) return;
+  if (!TRACE_is_active())
+    return;
+  if (!TRACE_smpi_is_enabled())
+    return;
 
   //declare category
   TRACE_category (category);
@@ -71,7 +74,10 @@ void TRACE_internal_smpi_set_category (const char *category)
 
 const char *TRACE_internal_smpi_get_category (void)
 {
-  if (!TRACE_smpi_is_enabled()) return NULL;
+  if (!TRACE_is_active())
+    return NULL;
+  if (!TRACE_smpi_is_enabled())
+    return NULL;
 
   char processid[INSTR_DEFAULT_STR_SIZE];
   snprintf (processid, INSTR_DEFAULT_STR_SIZE, "%p", SIMIX_process_self());
@@ -86,22 +92,22 @@ void TRACE_smpi_alloc()
 
 void TRACE_smpi_start(void)
 {
-  if (TRACE_smpi_is_enabled()) {
+  if (TRACE_is_enabled()) {
     TRACE_start();
   }
 }
 
 void TRACE_smpi_release(void)
 {
-  TRACE_surf_release();
-  if (TRACE_smpi_is_enabled()) {
+  if (TRACE_is_enabled()) {
+    TRACE_surf_release();
     TRACE_end();
   }
 }
 
 void TRACE_smpi_init(int rank)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -120,7 +126,7 @@ void TRACE_smpi_init(int rank)
 
 void TRACE_smpi_finalize(int rank)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -130,7 +136,7 @@ void TRACE_smpi_finalize(int rank)
 
 void TRACE_smpi_collective_in(int rank, int root, const char *operation)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -138,12 +144,12 @@ void TRACE_smpi_collective_in(int rank, int root, const char *operation)
   container_t container = getContainer (str);
   type_t type = getType ("MPI_STATE");
 
-  pajePushState(SIMIX_get_clock(), type->id, container->id, operation);
+  new_pajePushState (SIMIX_get_clock(), container, type, operation);
 }
 
 void TRACE_smpi_collective_out(int rank, int root, const char *operation)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -151,12 +157,12 @@ void TRACE_smpi_collective_out(int rank, int root, const char *operation)
   container_t container = getContainer (str);
   type_t type = getType ("MPI_STATE");
 
-  pajePopState(SIMIX_get_clock(), type->id, container->id);
+  new_pajePopState (SIMIX_get_clock(), container, type);
 }
 
 void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -164,12 +170,12 @@ void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation)
   container_t container = getContainer (str);
   type_t type = getType ("MPI_STATE");
 
-  pajePushState(SIMIX_get_clock(), type->id, container->id, operation);
+  new_pajePushState (SIMIX_get_clock(), container, type, operation);
 }
 
 void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
@@ -177,12 +183,12 @@ void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
   container_t container = getContainer (str);
   type_t type = getType ("MPI_STATE");
 
-  pajePopState(SIMIX_get_clock(), type->id, container->id);
+  new_pajePopState (SIMIX_get_clock(), container, type);
 }
 
 void TRACE_smpi_send(int rank, int src, int dst)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char key[INSTR_DEFAULT_STR_SIZE];
@@ -193,12 +199,12 @@ void TRACE_smpi_send(int rank, int src, int dst)
   container_t container = getContainer (str);
   type_t type = getType ("MPI_LINK");
 
-  pajeStartLink(SIMIX_get_clock(), type->id, type->father->id, "PTP", container->id, key);
+  new_pajeStartLink (SIMIX_get_clock(), getRootContainer(), type, container, "PTP", key);
 }
 
 void TRACE_smpi_recv(int rank, int src, int dst)
 {
-  if (!TRACE_smpi_is_enabled())
+  if (!(TRACE_is_active() && TRACE_smpi_is_enabled()))
     return;
 
   char key[INSTR_DEFAULT_STR_SIZE];
@@ -209,6 +215,6 @@ void TRACE_smpi_recv(int rank, int src, int dst)
   container_t container = getContainer (str);
   type_t type = getType ("MPI_LINK");
 
-  pajeEndLink(SIMIX_get_clock(), type->id, type->father->id, "PTP", container->id, key);
+  new_pajeEndLink (SIMIX_get_clock(), getRootContainer(), type, container, "PTP", key);
 }
 #endif /* HAVE_TRACING */