Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Fix headers for call-location tracing.
[simgrid.git] / tools / smpi / generate_smpi_defines.pl
index a719771..1306f45 100755 (executable)
@@ -40,7 +40,12 @@ sub output_macro {
     print "#define ". uc($id) ." smpi_trace_set_call_location(__FILE__,__LINE__); call ". lc $id ."\n";
   }
   else {
-    print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n";
+    if ($id eq "MPI_Init") {
+      print "#define MPI_Init(...) ({ smpi_process_init(__VA_ARGS__); smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init(NULL, NULL); })\n";
+    }
+    else {
+      print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n";
+    }
   }
 }