1
1

Test the return status code from comm_dyn_start_processes - if we see an error, then let's report it and not continue on with the comm_spawn procedure!

This commit was SVN r14699.
Этот коммит содержится в:
Ralph Castain 2007-05-18 20:22:32 +00:00
родитель 180c96bb8f
Коммит fa5a40070d
2 изменённых файлов: 13 добавлений и 7 удалений

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

@ -40,7 +40,7 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info,
{
int rank, rc, i;
int send_first=0; /* we wait to be contacted */
ompi_communicator_t *newcomp;
ompi_communicator_t *newcomp=NULL;
char port_name[MPI_MAX_PORT_NAME];
char *tmp_port;
orte_rml_tag_t tag;
@ -91,8 +91,10 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info,
/* Open a port. The port_name is passed as an environment variable
to the children. */
ompi_open_port (port_name);
ompi_comm_start_processes (1, &command, &argv, &maxprocs,
&info, port_name);
if (OMPI_SUCCESS != (rc = ompi_comm_start_processes (1, &command, &argv, &maxprocs,
&info, port_name))) {
goto ERROR;
}
tmp_port = ompi_parse_port (port_name, &tag);
free(tmp_port);
}
@ -100,7 +102,8 @@ int MPI_Comm_spawn(char *command, char **argv, int maxprocs, MPI_Info info,
rc = ompi_comm_connect_accept (comm, root, NULL, send_first, &newcomp, tag);
/* close the port again. Nothing has to be done for that at the moment.*/
ERROR:
/* close the port again. Nothing has to be done for that at the moment.*/
/* set error codes */
if (MPI_ERRCODES_IGNORE != array_of_errcodes) {

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

@ -107,15 +107,18 @@ int MPI_Comm_spawn_multiple(int count, char **array_of_commands, char ***array_o
/* Open a port. The port_name is passed as an environment variable
* to the children. */
ompi_open_port (port_name);
ompi_comm_start_processes(count, array_of_commands,
array_of_argv, array_of_maxprocs,
array_of_info, port_name);
if (OMPI_SUCCESS != (rc = ompi_comm_start_processes(count, array_of_commands,
array_of_argv, array_of_maxprocs,
array_of_info, port_name))) {
goto ERROR;
}
tmp_port = ompi_parse_port (port_name, &tag);
free(tmp_port);
}
rc = ompi_comm_connect_accept (comm, root, NULL, send_first, &newcomp, tag);
ERROR:
/* close the port again. Nothing has to be done for that at the moment.*/
/* set array of errorcodes */