Add a few checks to ensure that MPI_INIT(NULL, NULL) and
MPI_INIT_THREAD(NULL, NULL, ...) will work properly. This commit was SVN r2362.
Этот коммит содержится в:
родитель
e929014423
Коммит
e2aaf64239
@ -58,6 +58,10 @@ int MPI_Init(int *argc, char ***argv)
|
|||||||
little in this function as possible so that if it's profiled, we
|
little in this function as possible so that if it's profiled, we
|
||||||
don't lose anything) */
|
don't lose anything) */
|
||||||
|
|
||||||
err = ompi_mpi_init(*argc, *argv, required, &provided);
|
if (NULL != argc && NULL != argv) {
|
||||||
|
err = ompi_mpi_init(*argc, *argv, required, &provided);
|
||||||
|
} else {
|
||||||
|
err = ompi_mpi_init(NULL, NULL, required, &provided);
|
||||||
|
}
|
||||||
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,10 @@ int MPI_Init_thread(int *argc, char ***argv, int required,
|
|||||||
little in this function as possible so that if it's profiled, we
|
little in this function as possible so that if it's profiled, we
|
||||||
don't lose anything) */
|
don't lose anything) */
|
||||||
|
|
||||||
err = ompi_mpi_init(*argc, *argv, required, provided);
|
if (NULL != argc && NULL != argv) {
|
||||||
|
err = ompi_mpi_init(*argc, *argv, required, provided);
|
||||||
|
} else {
|
||||||
|
err = ompi_mpi_init(NULL, NULL, required, provided);
|
||||||
|
}
|
||||||
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
@ -171,6 +171,12 @@ int ompi_cmd_line_parse(ompi_cmd_line_t *cmd, bool ignore_unknown,
|
|||||||
bool is_unknown;
|
bool is_unknown;
|
||||||
bool is_option;
|
bool is_option;
|
||||||
|
|
||||||
|
/* Bozo check */
|
||||||
|
|
||||||
|
if (0 == argc || NULL == argv) {
|
||||||
|
return OMPI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/* Thread serialization */
|
/* Thread serialization */
|
||||||
|
|
||||||
ompi_mutex_lock(&cmd->lcl_mutex);
|
ompi_mutex_lock(&cmd->lcl_mutex);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user