[PATCH] Support hybrid MPI/OpenMP if available

Jeffrey D. Oldham oldham at codesourcery.com
Thu Jan 8 21:43:48 UTC 2004


Richard Guenther wrote:
> 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

OpenMP does not support MPI_init?  I'd prefer to initialize OpenMP using 
the same mechanism as for MPI implementations.

Also, does finalization also need to change?

-- 
Jeffrey D. Oldham
oldham at codesourcery.com




More information about the pooma-dev mailing list