[PATCH] Support hybrid MPI/OpenMP if available

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Wed Jan 7 16:57:46 UTC 2004


Hi!

This patch makes sure to correctly initialize MPI according to the
standard when using OpenMP.

Tested with mpich and Intel icpc where in fact, this mode is not supported
appearantly.

Ok?

Richard.


2004Jan07  Richard Guenther <richard.guenther at uni-tuebingen.de>

	* src/Pooma/Pooma.cmpl.cpp: initialize MPI using MPI_Init_thread
	if _OPENMP is defined, require at least MPI_THREAD_FUNNELED
	support.

===== Pooma/Pooma.cmpl.cpp 1.6 vs edited =====
--- 1.6/r2/src/Pooma/Pooma.cmpl.cpp	Wed Jan  7 12:23:35 2004
+++ edited/Pooma/Pooma.cmpl.cpp	Wed Jan  7 17:54:30 2004
@@ -288,7 +288,13 @@
   // the Cheetah options from the Options object.

 #if POOMA_MPI
+# ifdef _OPENMP
+  int provided;
+  MPI_Init_thread(&argc, &argv, MPI_THREAD_FUNNELED, &provided);
+  PInsist(provided >= MPI_THREAD_FUNNELED, "No MPI support for OpenMP");
+# else
   MPI_Init(&argc, &argv);
+# endif
 #elif POOMA_CHEETAH
   controller_g = new Cheetah::Controller(argc, argv);
 #endif



More information about the pooma-dev mailing list