Cosmetic: expunge some more old 2-space-indent code (re-indent with
"indent(1)"). This commit was SVN r20179.
Этот коммит содержится в:
родитель
e1f40c6a71
Коммит
611ebeab33
@ -39,61 +39,65 @@ static const char FUNC_NAME[] = "MPI_Init";
|
|||||||
|
|
||||||
int MPI_Init(int *argc, char ***argv)
|
int MPI_Init(int *argc, char ***argv)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
int provided;
|
int provided;
|
||||||
char *env;
|
char *env;
|
||||||
int required = MPI_THREAD_SINGLE;
|
int required = MPI_THREAD_SINGLE;
|
||||||
|
|
||||||
/* Ensure that we were not already initialized or finalized */
|
/* Ensure that we were not already initialized or finalized */
|
||||||
|
|
||||||
if (ompi_mpi_finalized) {
|
if (ompi_mpi_finalized) {
|
||||||
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
|
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
|
||||||
orte_show_help("help-mpi-api.txt", "mpi-function-after-finalize",
|
orte_show_help("help-mpi-api.txt",
|
||||||
true, FUNC_NAME);
|
"mpi-function-after-finalize", true, FUNC_NAME);
|
||||||
}
|
}
|
||||||
return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM,
|
return ompi_errhandler_invoke(NULL, NULL,
|
||||||
MPI_ERR_OTHER, FUNC_NAME);
|
OMPI_ERRHANDLER_TYPE_COMM,
|
||||||
} else if (ompi_mpi_initialized) {
|
MPI_ERR_OTHER, FUNC_NAME);
|
||||||
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
|
} else if (ompi_mpi_initialized) {
|
||||||
orte_show_help("help-mpi-api.txt", "mpi-initialize-twice",
|
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
|
||||||
true, FUNC_NAME);
|
orte_show_help("help-mpi-api.txt", "mpi-initialize-twice",
|
||||||
}
|
true, FUNC_NAME);
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
}
|
||||||
}
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER,
|
||||||
|
FUNC_NAME);
|
||||||
/* check for environment overrides for required thread level. If
|
|
||||||
there is, check to see that it is a valid/supported thread level.
|
|
||||||
If not, default to MPI_THREAD_MULTIPLE. */
|
|
||||||
|
|
||||||
if (NULL != (env = getenv("OMPI_MPI_THREAD_LEVEL"))) {
|
|
||||||
required = atoi(env);
|
|
||||||
if (required < MPI_THREAD_SINGLE || required > MPI_THREAD_MULTIPLE) {
|
|
||||||
required = MPI_THREAD_MULTIPLE;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Call the back-end initialization function (we need to put as
|
/* check for environment overrides for required thread level. If
|
||||||
little in this function as possible so that if it's profiled, we
|
there is, check to see that it is a valid/supported thread level.
|
||||||
don't lose anything) */
|
If not, default to MPI_THREAD_MULTIPLE. */
|
||||||
|
|
||||||
if (NULL != argc && NULL != argv) {
|
if (NULL != (env = getenv("OMPI_MPI_THREAD_LEVEL"))) {
|
||||||
err = ompi_mpi_init(*argc, *argv, required, &provided);
|
required = atoi(env);
|
||||||
} else {
|
if (required < MPI_THREAD_SINGLE || required > MPI_THREAD_MULTIPLE) {
|
||||||
err = ompi_mpi_init(0, NULL, required, &provided);
|
required = MPI_THREAD_MULTIPLE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Since we don't have a communicator to invoke an errorhandler on
|
/* Call the back-end initialization function (we need to put as
|
||||||
here, don't use the fancy-schmancy ERRHANDLER macros; they're
|
little in this function as possible so that if it's profiled, we
|
||||||
really designed for real communicator objects. Just use the
|
don't lose anything) */
|
||||||
back-end function directly. */
|
|
||||||
|
|
||||||
if (MPI_SUCCESS != err) {
|
if (NULL != argc && NULL != argv) {
|
||||||
return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM,
|
err = ompi_mpi_init(*argc, *argv, required, &provided);
|
||||||
err < 0 ? ompi_errcode_get_mpi_code(err) :
|
} else {
|
||||||
err, FUNC_NAME);
|
err = ompi_mpi_init(0, NULL, required, &provided);
|
||||||
}
|
}
|
||||||
|
|
||||||
OPAL_CR_INIT_LIBRARY();
|
/* Since we don't have a communicator to invoke an errorhandler on
|
||||||
|
here, don't use the fancy-schmancy ERRHANDLER macros; they're
|
||||||
|
really designed for real communicator objects. Just use the
|
||||||
|
back-end function directly. */
|
||||||
|
|
||||||
return MPI_SUCCESS;
|
if (MPI_SUCCESS != err) {
|
||||||
|
return ompi_errhandler_invoke(NULL, NULL,
|
||||||
|
OMPI_ERRHANDLER_TYPE_COMM,
|
||||||
|
err <
|
||||||
|
0 ? ompi_errcode_get_mpi_code(err) :
|
||||||
|
err, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
OPAL_CR_INIT_LIBRARY();
|
||||||
|
|
||||||
|
return MPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user