freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pooma-dev] Re: [PATCH] Support hybrid MPI/OpenMP if available


From: Jeffrey D. Oldham
Subject: Re: [pooma-dev] Re: [PATCH] Support hybrid MPI/OpenMP if available
Date: Thu, 08 Jan 2004 13:59:09 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Richard Guenther wrote:
On Thu, 8 Jan 2004, Jeffrey D. Oldham wrote:


Richard Guenther wrote:

#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.


It's somewhat difficult.  The MPI-1 standard does not support any sort of
threading and has only MPI_Init.  The MPI-2 standard does support many
levels of thread support which needs to be specified through
MPI_Init_thread - though using MPI_Init is still possible, which is
equivalent to initializing with no thread support.

Nearly all implementation support the MPI_Init_thread call as part of
(usually incomplete) MPI-2 support.  To allow using OpenMP if MPI is used,
too, we need at least make the MPI library aware of this.  So, if no
OpenMP is used, MPI_Init suffices and allows for MPI-1 only
implementations.  For OpenMP support we absolutely need MPI_Init_threads,
so we use it.


Also, does finalization also need to change?


No.

Ok with this explanation?

Yes.  I appreciate the education.

Thanks,
Richard.


--
Jeffrey D. Oldham
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]