Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mark the smpi_exit call as noreturn, and really kill the process when exit is called
[simgrid.git] / src / smpi / internals / smpi_global.cpp
index 674cfed..65453e4 100644 (file)
@@ -635,3 +635,12 @@ void SMPI_thread_create() {
   TRACE_smpi_init(simgrid::s4u::this_actor::get_pid(), __func__);
   smpi_process()->mark_as_initialized();
 }
+
+void smpi_exit(int res){
+  if(res != 0){
+    XBT_WARN("SMPI process did not return 0. Return value : %d", res);
+    smpi_exit_status = res;
+  }
+  simgrid::s4u::this_actor::exit();
+  while(1);//necessary for the noreturn attribute
+}