Skip to content

Commit 55bcda1

Browse files
AboorvaDevarajanawlauria
authored andcommitted
Allow mpi_init_thread to override the MPI_THREAD_LEVEL
Signed-off-by: Austen Lauria <awlauria@us.ibm.com> (cherry picked from commit babfd93)
1 parent aa4529b commit 55bcda1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ompi/mpi/c/init_thread.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@ int MPI_Init_thread(int *argc, char ***argv, int required,
4848
int *provided)
4949
{
5050
int err;
51+
char *env;
5152

5253
ompi_hook_base_mpi_init_thread_top(argc, argv, required, provided);
5354

55+
if (NULL != (env = getenv("OMPI_MPI_THREAD_LEVEL"))) {
56+
required = atoi(env);
57+
}
58+
5459
if ( MPI_PARAM_CHECK ) {
5560
if (required < MPI_THREAD_SINGLE || required > MPI_THREAD_MULTIPLE) {
5661
ompi_mpi_errors_are_fatal_comm_handler(NULL, NULL, FUNC_NAME);

0 commit comments

Comments
 (0)