Activate thread support ... at least at the MPI level.
This commit was SVN r7386.
Этот коммит содержится в:
родитель
32cdc551af
Коммит
789d49d613
@ -33,27 +33,39 @@ static const char FUNC_NAME[] = "MPI_Init_thread";
|
|||||||
int MPI_Init_thread(int *argc, char ***argv, int required,
|
int MPI_Init_thread(int *argc, char ***argv, int required,
|
||||||
int *provided)
|
int *provided)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
MPI_Comm null = NULL;
|
MPI_Comm null = NULL;
|
||||||
|
|
||||||
/* Ensure that we were not already initialized or finalized */
|
/*
|
||||||
|
* A thread compliant MPI implementation will be able to return provided
|
||||||
|
* = MPI_THREAD_MULTIPLE. Such an implementation may always return provided
|
||||||
|
* = MPI_THREAD_MULTIPLE, irrespective of the value of required.
|
||||||
|
*/
|
||||||
|
#if OMPI_ENABLE_MPI_THREADS
|
||||||
|
*provided = MPI_THREAD_MULTIPLE;
|
||||||
|
#else
|
||||||
|
*provided = MPI_THREAD_SINGLE;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ompi_mpi_finalized) {
|
/* Ensure that we were not already initialized or finalized */
|
||||||
/* JMS show_help */
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_OTHER, FUNC_NAME);
|
|
||||||
} else if (ompi_mpi_initialized) {
|
|
||||||
/* JMS show_help */
|
|
||||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Call the back-end initialization function (we need to put as
|
if (ompi_mpi_finalized) {
|
||||||
little in this function as possible so that if it's profiled, we
|
/* JMS show_help */
|
||||||
don't lose anything) */
|
return OMPI_ERRHANDLER_INVOKE(null, MPI_ERR_OTHER, FUNC_NAME);
|
||||||
|
} else if (ompi_mpi_initialized) {
|
||||||
|
/* JMS show_help */
|
||||||
|
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
if (NULL != argc && NULL != argv) {
|
/* Call the back-end initialization function (we need to put as
|
||||||
err = ompi_mpi_init(*argc, *argv, required, provided);
|
little in this function as possible so that if it's profiled, we
|
||||||
} else {
|
don't lose anything) */
|
||||||
err = ompi_mpi_init(0, NULL, required, provided);
|
|
||||||
}
|
if (NULL != argc && NULL != argv) {
|
||||||
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
err = ompi_mpi_init(*argc, *argv, required, provided);
|
||||||
|
} else {
|
||||||
|
err = ompi_mpi_init(0, NULL, required, provided);
|
||||||
|
}
|
||||||
|
|
||||||
|
OMPI_ERRHANDLER_RETURN(err, null, err, FUNC_NAME);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user