1
1

Minor changes so that mpirun now checks the exit status and code of each process and returns a non-zero exit code if any process didn't normally terminate. Should help with the testing.

This commit was SVN r3658.
Этот коммит содержится в:
Ralph Castain 2004-11-24 15:13:02 +00:00
родитель ce215e607c
Коммит 9de44317db
2 изменённых файлов: 20 добавлений и 3 удалений

Просмотреть файл

@ -13,7 +13,6 @@
#include "ompi_config.h"
#include "include/constants.h"
#include "runtime/runtime.h"
#include "mpi.h"
#include "event/event.h"
#include "group/group.h"

Просмотреть файл

@ -66,7 +66,9 @@ main(int argc, char *argv[])
char *contact_file, *filenm, *segment;
ompi_rte_spawn_handle_t *spawn_handle;
ompi_registry_notify_id_t rc_tag;
ompi_rte_process_status_t *proc_status;
ompi_list_t *status_list;
ompi_registry_value_t *value;
/*
* Intialize our Open MPI environment
*/
@ -323,6 +325,7 @@ main(int argc, char *argv[])
ompi_show_help("help-mpirun.txt", "mpirun:proc-reg-failed",
true, argv[0], ret);
ompi_rte_job_shutdown(new_jobid);
return -1;
} else {
ompi_rte_job_startup(new_jobid);
ompi_rte_monitor_procs_unregistered();
@ -332,6 +335,21 @@ main(int argc, char *argv[])
* - ompi_rte_kill_job()
*/
/*
* Determine if the processes all exited normally - if not, flag the output of mpirun
*/
ret = 0;
status_list = ompi_registry.get(OMPI_REGISTRY_OR, segment, NULL);
while (NULL != (value = (ompi_registry_value_t*)ompi_list_remove_first(status_list))) {
proc_status = ompi_rte_unpack_process_status(value);
if (OMPI_PROC_TERMINATING != proc_status->status_key) {
ret = -1;
}
if (0 != proc_status->exit_code) {
ret = proc_status->exit_code;
}
}
/*
* Clean up
*/
@ -353,6 +371,6 @@ main(int argc, char *argv[])
ompi_finalize();
OBJ_DESTRUCT(&schedlist);
return 0;
return ret;
}