Commit b32e308e authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Also check MPI Thread level in C test programs

parent 9c6345ed
......@@ -95,6 +95,7 @@ int main(int argc, char** argv) {
int np_cols, np_rows;
int my_prow, my_pcol;
int mpi_comm;
int provided_mpi_thread_level;
/* blacs */
int my_blacs_ctxt, sc_desc[9], info;
......@@ -109,9 +110,21 @@ int main(int argc, char** argv) {
int value;
#ifdef WITH_MPI
#ifndef WITH_OPENMP
MPI_Init(&argc, &argv);
#else
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided_mpi_thread_level);
if (provided_mpi_thread_level != MPI_THREAD_MULTIPLE) {
fprintf(stderr, "MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system\n");
MPI_Finalize();
exit(77);
}
#endif
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
#else
nprocs = 1;
myid = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment