1
1

Cosmetic: expunge some more old 2-space-indent code (re-indent with

"indent(1)").

This commit was SVN r20179.
Этот коммит содержится в:
Jeff Squyres 2009-01-02 12:55:17 +00:00
родитель e1f40c6a71
Коммит 611ebeab33

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

@ -39,61 +39,65 @@ static const char FUNC_NAME[] = "MPI_Init";
int MPI_Init(int *argc, char ***argv)
{
int err;
int provided;
char *env;
int required = MPI_THREAD_SINGLE;
int err;
int provided;
char *env;
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 (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
orte_show_help("help-mpi-api.txt", "mpi-function-after-finalize",
true, FUNC_NAME);
}
return ompi_errhandler_invoke(NULL, NULL, OMPI_ERRHANDLER_TYPE_COMM,
MPI_ERR_OTHER, FUNC_NAME);
} else if (ompi_mpi_initialized) {
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
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);
}
/* 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;
if (ompi_mpi_finalized) {
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
orte_show_help("help-mpi-api.txt",
"mpi-function-after-finalize", true, FUNC_NAME);
}
return ompi_errhandler_invoke(NULL, NULL,
OMPI_ERRHANDLER_TYPE_COMM,
MPI_ERR_OTHER, FUNC_NAME);
} else if (ompi_mpi_initialized) {
if (0 == ompi_comm_rank(MPI_COMM_WORLD)) {
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);
}
}
/* Call the back-end initialization function (we need to put as
little in this function as possible so that if it's profiled, we
don't lose anything) */
/* 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 != argc && NULL != argv) {
err = ompi_mpi_init(*argc, *argv, required, &provided);
} else {
err = ompi_mpi_init(0, NULL, required, &provided);
}
if (NULL != (env = getenv("OMPI_MPI_THREAD_LEVEL"))) {
required = atoi(env);
if (required < MPI_THREAD_SINGLE || required > MPI_THREAD_MULTIPLE) {
required = MPI_THREAD_MULTIPLE;
}
}
/* 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. */
/* Call the back-end initialization function (we need to put as
little in this function as possible so that if it's profiled, we
don't lose anything) */
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);
}
if (NULL != argc && NULL != argv) {
err = ompi_mpi_init(*argc, *argv, required, &provided);
} else {
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;
}