From ae78f3341e68b5dfbc4c5f7dfe38867ca5b57294 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 12 Oct 2022 22:16:47 -0400 Subject: [PATCH] Check result of MPI_Query_thread in if statements --- EXAMPLE/pddrive.c | 13 ++++--------- EXAMPLE/pddrive3d.c | 13 ++++--------- EXAMPLE/pddrive3d1.c | 13 ++++--------- EXAMPLE/pddrive3d2.c | 13 ++++--------- EXAMPLE/pddrive3d3.c | 13 ++++--------- EXAMPLE/pddrive_spawn.c | 31 +++++++++++++------------------ EXAMPLE/psdrive.c | 31 +++++++++++++------------------ EXAMPLE/psdrive3d.c | 13 ++++--------- EXAMPLE/psdrive3d1.c | 13 ++++--------- EXAMPLE/psdrive3d2.c | 13 ++++--------- EXAMPLE/psdrive3d3.c | 13 ++++--------- EXAMPLE/pzdrive.c | 31 +++++++++++++------------------ EXAMPLE/pzdrive3d.c | 13 ++++--------- EXAMPLE/pzdrive3d1.c | 13 ++++--------- EXAMPLE/pzdrive3d2.c | 13 ++++--------- EXAMPLE/pzdrive3d3.c | 13 ++++--------- EXAMPLE/pzdrive_spawn.c | 31 +++++++++++++------------------ 17 files changed, 104 insertions(+), 189 deletions(-) diff --git a/EXAMPLE/pddrive.c b/EXAMPLE/pddrive.c index 2b4b4381..d66ec15e 100755 --- a/EXAMPLE/pddrive.c +++ b/EXAMPLE/pddrive.c @@ -200,23 +200,18 @@ int main(int argc, char *argv[]) if(grid.iam==0){ MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } } diff --git a/EXAMPLE/pddrive3d.c b/EXAMPLE/pddrive3d.c index fa7fb1af..02f8fbad 100755 --- a/EXAMPLE/pddrive3d.c +++ b/EXAMPLE/pddrive3d.c @@ -267,23 +267,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pddrive3d1.c b/EXAMPLE/pddrive3d1.c index 2bf6edb4..dbfb300c 100755 --- a/EXAMPLE/pddrive3d1.c +++ b/EXAMPLE/pddrive3d1.c @@ -200,23 +200,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pddrive3d2.c b/EXAMPLE/pddrive3d2.c index c534889e..cd271335 100755 --- a/EXAMPLE/pddrive3d2.c +++ b/EXAMPLE/pddrive3d2.c @@ -207,23 +207,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pddrive3d3.c b/EXAMPLE/pddrive3d3.c index d8b2477c..dd30b56a 100755 --- a/EXAMPLE/pddrive3d3.c +++ b/EXAMPLE/pddrive3d3.c @@ -204,23 +204,18 @@ main (int argc, char *argv[]) if (grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pddrive_spawn.c b/EXAMPLE/pddrive_spawn.c index e8215555..464e046e 100755 --- a/EXAMPLE/pddrive_spawn.c +++ b/EXAMPLE/pddrive_spawn.c @@ -129,24 +129,19 @@ int main(int argc, char *argv[]) if(grid.iam==0){ MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: - printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); - fflush(stdout); - break; - case MPI_THREAD_FUNNELED: - printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); - fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: - printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); - fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: - printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); - fflush(stdout); - break; - } + if (omp_mpi_level == MPI_THREAD_SINGLE) { + printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { + printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { + printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { + printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); + fflush(stdout); + } } /* Bail out if I do not belong in the grid. */ diff --git a/EXAMPLE/psdrive.c b/EXAMPLE/psdrive.c index 47be729f..8acc8b00 100644 --- a/EXAMPLE/psdrive.c +++ b/EXAMPLE/psdrive.c @@ -200,24 +200,19 @@ int main(int argc, char *argv[]) if(grid.iam==0){ MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: - printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); - fflush(stdout); - break; - case MPI_THREAD_FUNNELED: - printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); - fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: - printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); - fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: - printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); - fflush(stdout); - break; - } + if (omp_mpi_level == MPI_THREAD_SINGLE) { + printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { + printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { + printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { + printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); + fflush(stdout); + } } /* Bail out if I do not belong in the grid. */ diff --git a/EXAMPLE/psdrive3d.c b/EXAMPLE/psdrive3d.c index 91997525..6abd05c2 100644 --- a/EXAMPLE/psdrive3d.c +++ b/EXAMPLE/psdrive3d.c @@ -267,23 +267,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/psdrive3d1.c b/EXAMPLE/psdrive3d1.c index 07627d01..4038743a 100755 --- a/EXAMPLE/psdrive3d1.c +++ b/EXAMPLE/psdrive3d1.c @@ -200,23 +200,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/psdrive3d2.c b/EXAMPLE/psdrive3d2.c index a720dec3..fd8e8d8c 100755 --- a/EXAMPLE/psdrive3d2.c +++ b/EXAMPLE/psdrive3d2.c @@ -207,23 +207,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/psdrive3d3.c b/EXAMPLE/psdrive3d3.c index ce740388..1b833ead 100755 --- a/EXAMPLE/psdrive3d3.c +++ b/EXAMPLE/psdrive3d3.c @@ -204,23 +204,18 @@ main (int argc, char *argv[]) if (grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pzdrive.c b/EXAMPLE/pzdrive.c index 789472a4..c5e4ec67 100755 --- a/EXAMPLE/pzdrive.c +++ b/EXAMPLE/pzdrive.c @@ -199,24 +199,19 @@ int main(int argc, char *argv[]) if(grid.iam==0){ MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: - printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); - fflush(stdout); - break; - case MPI_THREAD_FUNNELED: - printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); - fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: - printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); - fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: - printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); - fflush(stdout); - break; - } + if (omp_mpi_level == MPI_THREAD_SINGLE) { + printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { + printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { + printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { + printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); + fflush(stdout); + } } /* Bail out if I do not belong in the grid. */ diff --git a/EXAMPLE/pzdrive3d.c b/EXAMPLE/pzdrive3d.c index 9d20fc0f..ce1906a0 100755 --- a/EXAMPLE/pzdrive3d.c +++ b/EXAMPLE/pzdrive3d.c @@ -267,23 +267,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pzdrive3d1.c b/EXAMPLE/pzdrive3d1.c index b5d147ed..ee40a694 100755 --- a/EXAMPLE/pzdrive3d1.c +++ b/EXAMPLE/pzdrive3d1.c @@ -200,23 +200,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pzdrive3d2.c b/EXAMPLE/pzdrive3d2.c index 5799b647..9c79145c 100755 --- a/EXAMPLE/pzdrive3d2.c +++ b/EXAMPLE/pzdrive3d2.c @@ -207,23 +207,18 @@ main (int argc, char *argv[]) if(grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pzdrive3d3.c b/EXAMPLE/pzdrive3d3.c index e3addd78..7e64ee31 100755 --- a/EXAMPLE/pzdrive3d3.c +++ b/EXAMPLE/pzdrive3d3.c @@ -204,23 +204,18 @@ main (int argc, char *argv[]) if (grid.iam==0) { MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: + if (omp_mpi_level == MPI_THREAD_SINGLE) { printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); fflush(stdout); - break; - case MPI_THREAD_FUNNELED: + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); fflush(stdout); - break; } fflush(stdout); } diff --git a/EXAMPLE/pzdrive_spawn.c b/EXAMPLE/pzdrive_spawn.c index ecf0d272..a0670b71 100755 --- a/EXAMPLE/pzdrive_spawn.c +++ b/EXAMPLE/pzdrive_spawn.c @@ -129,24 +129,19 @@ int main(int argc, char *argv[]) if(grid.iam==0){ MPI_Query_thread(&omp_mpi_level); - switch (omp_mpi_level) { - case MPI_THREAD_SINGLE: - printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); - fflush(stdout); - break; - case MPI_THREAD_FUNNELED: - printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); - fflush(stdout); - break; - case MPI_THREAD_SERIALIZED: - printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); - fflush(stdout); - break; - case MPI_THREAD_MULTIPLE: - printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); - fflush(stdout); - break; - } + if (omp_mpi_level == MPI_THREAD_SINGLE) { + printf("MPI_Query_thread with MPI_THREAD_SINGLE\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_FUNNELED) { + printf("MPI_Query_thread with MPI_THREAD_FUNNELED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_SERIALIZED) { + printf("MPI_Query_thread with MPI_THREAD_SERIALIZED\n"); + fflush(stdout); + } else if (omp_mpi_level == MPI_THREAD_MULTIPLE) { + printf("MPI_Query_thread with MPI_THREAD_MULTIPLE\n"); + fflush(stdout); + } } /* Bail out if I do not belong in the grid. */