X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1c175147cb92a354153248569a18794834b361f6..ecdbfb840d579e6ea34d9676a8feb9fab975ea32:/src/smpi/internals/smpi_global.cpp diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 776bdcf707..47c2a5cd04 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -57,6 +57,7 @@ std::unordered_map location2speedup; static std::map process_data; int process_count = 0; +static int smpi_exit_status = 0; int smpi_universe_size = 0; extern double smpi_total_benched_time; xbt_os_timer_t global_timer; @@ -419,6 +420,8 @@ static int smpi_run_entry_point(smpi_entry_point_type entry_point, std::vectorset_return_value(res); + if (smpi_exit_status == 0) + smpi_exit_status = res; } return 0; } @@ -591,19 +594,11 @@ int smpi_main(const char* executable, int argc, char *argv[]) "You may want to use sampling functions or trace replay to reduce this."); } } - int ret = 0; - for (auto& pair : process_data) { - auto& smpi_process = pair.second; - if (smpi_process->return_value() != 0) { - ret = smpi_process->return_value(); // return first non 0 value - break; - } - } smpi_global_destroy(); TRACE_end(); - return ret; + return smpi_exit_status; } // Called either directly from the user code, or from the code called by smpirun