2004-01-09 11:28:38 +03:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "lam_config.h"
|
|
|
|
|
2004-01-15 09:11:45 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2004-01-09 11:28:38 +03:00
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
|
|
|
#include "runtime/runtime.h"
|
2004-01-09 11:28:38 +03:00
|
|
|
|
2004-01-15 08:24:14 +03:00
|
|
|
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
|
|
|
|
#pragma weak MPI_Init = PMPI_Init
|
2004-01-09 11:28:38 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2004-01-15 09:11:45 +03:00
|
|
|
int MPI_Init(int *argc, char ***argv)
|
2004-01-09 11:28:38 +03:00
|
|
|
{
|
2004-01-15 09:11:45 +03:00
|
|
|
int provided;
|
|
|
|
char *env;
|
|
|
|
int requested = MPI_THREAD_SINGLE;
|
|
|
|
|
|
|
|
/* check for environment overrides for requested thread level. If
|
|
|
|
there is, check to see that it is a valid/supported thread level.
|
|
|
|
If not, default to MPI_THREAD_SINGLE. */
|
|
|
|
|
|
|
|
if (NULL != (env = getenv("LAM_MPI_THREAD_LEVEL"))) {
|
|
|
|
requested = atoi(env);
|
|
|
|
if (requested < MPI_THREAD_SINGLE || requested > MPI_THREAD_MULTIPLE) {
|
|
|
|
/* JMS call the show_help() interface */
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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) */
|
|
|
|
|
|
|
|
return lam_mpi_init(*argc, *argv, requested, &provided);
|
2004-01-09 11:28:38 +03:00
|
|
|
}
|