Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sed -i -e 's/\t/ /g' *.[ch] Please people, stop using tabs in your source
[simgrid.git] / src / instr / instr_smpi.c
index 92914be..060f0a9 100644 (file)
@@ -184,10 +184,7 @@ void TRACE_smpi_collective_in(int rank, int root, const char *operation)
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
-  val_t value = PJ_value_get (operation, type);
-  if (value == NULL){
-    value = PJ_value_new (operation, color, type);
-  }
+  val_t value = PJ_value_get_or_new (operation, color, type);
   new_pajePushState (SIMIX_get_clock(), container, type, value);
 }
 
@@ -213,10 +210,7 @@ void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation)
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
-  val_t value = PJ_value_get (operation, type);
-  if (value == NULL){
-    value = PJ_value_new (operation, color, type);
-  }
+  val_t value = PJ_value_get_or_new (operation, color, type);
   new_pajePushState (SIMIX_get_clock(), container, type, value);
 }