-----Original Message----- From: "Tim Prince" [n...@aol.com] List-Post: users@lists.open-mpi.org Date: 06/12/2010 01:40 PM To: us...@open-mpi.org Subject: Re: [OMPI users] meaning of MPI_THREAD_*
>On 12/6/2010 3:16 AM, Hicham Mouline wrote: >> Hello, >> >> 1. MPI_THREAD_SINGLE: Only one thread will execute. >> Does this really mean the process cannot have any other threads at all, even >> if they doen't deal with MPI at all? >> I'm curious as to how this case affects the openmpi implementation? >> Essentially, what is the difference between MPI_THREAD_SINGLE and >> MPI_THREAD_FUNNELED? >> >> 2. In my case, I'm interested in MPI_THREAD_SERIALIZED. However if it's >> available, I can use MPI_THREAD_FUNNELED. >> What cmake flags do I need to enable to allow this mode? >> >> 3. Assume I assign only 1 thread in my program to deal with MPI. What is the >> difference between >> int MPI::Init_thread(MPI_THREAD_SINGLE) >> int MPI::Init_thread(MPI_THREAD_FUNNELED) >> int MPI::Init() >> >You're question is too broad; perhaps you didn't intend it that way. >Are you trying to do something which may work only with a specific >version of openmpi, or are you willing to adhere to portable practice? >I. tend to believe what it says at >http://www.mcs.anl.gov/research/projects/mpi/mpi-standard/mpi-report-2.0/node165.htm >including: >A call to MPI_INIT has the same effect as a call to MPI_INIT_THREAD with >a required = MPI_THREAD_SINGLE >You would likely use one of those if all your MPI calls are from a >single thread, and you don't perform any threading inside MPI. MPI >implementations vary on the extent to which a higher level of threading >than what is declared can be used successfully (there's no guarantee of >bad results if you exceed what was set by MPI_INIT). There shouldn't >be any bad effect from setting a higher level of thread support which >you never use. >I would think your question about cmake flags would apply only once you >chose a compiler. I have never seen anyone try mixing >auto-parallelization with MPI; that would require MPI_THREAD_MULTIPLE >but still appears unpredictable. MPI_THREAD_FUNNELED is used often with >OpenMP parallelization inside MPI. >-- >Tim Prince Thanks, it is now clarified that a call to MPI_INIT has the same effect as a call to MPI_INIT_THREAD with a required = MPI_THREAD_SINGLE. Perhaps it should be added here: http://www.open-mpi.org/doc/v1.4/man3/MPI_Init_thread.3.php as well. I try to remain portable but am using only openmpi at the moment. It is still unclear to me the difference between MPI_THREAD_SINGLE and MPI_THREAD_FUNNELED. Whether a program is or no multi threaded, if using MPI only from 1 thread (the one that calls MPI_INIT) would have no bearing on the mpi implementation, or? regards,