Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use C++ style includes when available.
[simgrid.git] / src / smpi / internals / instr_smpi.cpp
index aca15f0..ec33a27 100644 (file)
@@ -6,10 +6,10 @@
 
 #include "private.h"
 #include "private.hpp"
-#include <ctype.h>
+#include <cctype>
+#include <cstdarg>
+#include <cwchar>
 #include <simgrid/sg_config.h>
-#include <stdarg.h>
-#include <wchar.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_smpi, instr, "Tracing SMPI");
 
@@ -233,8 +233,8 @@ void TRACE_smpi_finalize(int rank)
   PJ_container_free (container);
 }
 
-void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_extra_data extra)
-{ paje_value pj_value;
+void TRACE_smpi_collective_in(int rank, const char *operation, instr_extra_data extra)
+{
   if (not TRACE_smpi_is_enabled()) {
     cleanup_extra_data(extra);
     return;
@@ -245,11 +245,11 @@ void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_e
   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.PJ_value_get_or_new (operation, color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new(operation, color, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
-void TRACE_smpi_collective_out(int rank, int root, const char *operation)
+void TRACE_smpi_collective_out(int rank, const char *operation)
 {
   if (not TRACE_smpi_is_enabled())
     return;
@@ -263,7 +263,7 @@ void TRACE_smpi_collective_out(int rank, int root, const char *operation)
 }
 
 void TRACE_smpi_computing_init(int rank)
-{ paje_value pj_value;
+{
  //first use, initialize the color in the trace
  if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing())
    return;
@@ -273,12 +273,11 @@ void TRACE_smpi_computing_init(int rank)
  container_t container = PJ_container_get(str);
  type_t type           = PJ_type_get("MPI_STATE", container->type);
  const char* color     = instr_find_color("computing");
- val_t value           = pj_value.PJ_value_get_or_new("computing", color, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, value);
+ new PushStateEvent(SIMIX_get_clock(), container, type, value::get_or_new("computing", color, type));
 }
 
 void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
-{ paje_value pj_value;
+{
   //do not forget to set the color first, otherwise this will explode
   if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_computing()) {
     cleanup_extra_data(extra);
@@ -289,8 +288,8 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = pj_value.PJ_value_get_or_new ("computing", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new("computing", nullptr, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_computing_out(int rank)
@@ -305,7 +304,7 @@ void TRACE_smpi_computing_out(int rank)
 }
 
 void TRACE_smpi_sleeping_init(int rank)
-{ paje_value pj_value;
+{
   //first use, initialize the color in the trace
   if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping())
     return;
@@ -315,12 +314,12 @@ void TRACE_smpi_sleeping_init(int rank)
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color ("sleeping");
-  val_t value = pj_value.PJ_value_get_or_new ("sleeping", color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value);
+  value* val            = value::get_or_new("sleeping", color, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val);
 }
 
 void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
-{ paje_value pj_value;
+{
   //do not forget to set the color first, otherwise this will explode
   if (not TRACE_smpi_is_enabled() || not TRACE_smpi_is_sleeping()) {
     cleanup_extra_data(extra);
@@ -331,8 +330,8 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = pj_value.PJ_value_get_or_new ("sleeping", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new("sleeping", nullptr, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_sleeping_out(int rank)
@@ -347,7 +346,7 @@ void TRACE_smpi_sleeping_out(int rank)
 }
 
 void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
-{ paje_value pj_value;
+{
   //do not forget to set the color first, otherwise this will explode
   if (not TRACE_smpi_is_enabled()) {
     cleanup_extra_data(extra);
@@ -358,8 +357,8 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = pj_value.PJ_value_get_or_new ("test", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new("test", nullptr, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_testing_out(int rank)
@@ -373,8 +372,8 @@ void TRACE_smpi_testing_out(int rank)
   new PopStateEvent (SIMIX_get_clock(), container, type);
 }
 
-void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra)
-{ paje_value pj_value;
+void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra)
+{
   if (not TRACE_smpi_is_enabled()) {
     cleanup_extra_data(extra);
     return;
@@ -385,11 +384,11 @@ void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_
   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.PJ_value_get_or_new (operation, color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new(operation, color, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
-void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation)
+void TRACE_smpi_ptp_out(int rank, int dst, const char *operation)
 {
   if (not TRACE_smpi_is_enabled())
     return;
@@ -418,7 +417,7 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
   new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
 }
 
-void TRACE_smpi_recv(int rank, int src, int dst, int tag)
+void TRACE_smpi_recv(int src, int dst, int tag)
 {
   if (not TRACE_smpi_is_enabled())
     return;