Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a function to determine whether SMPI is currently used
[simgrid.git] / src / smpi / internals / smpi_global.cpp
index 03048a0..3ff42f8 100644 (file)
@@ -583,6 +583,11 @@ int smpi_main(const char* executable, int argc, char* argv[])
   return smpi_exit_status;
 }
 
+static bool smpi_inited = false;
+int SMPI_is_inited()
+{
+  return smpi_inited;
+}
 // Called either directly from the user code, or from the code called by smpirun
 void SMPI_init(){
   smpi_init_options_internal(false);
@@ -601,6 +606,7 @@ void SMPI_init(){
   }
   smpi_init_papi();
   smpi_check_options();
+  smpi_inited = true;
 }
 
 void SMPI_finalize()