Re: [OMPI users] multi-threaded programming
On Mar 8, 2011, at 12:34 PM, Eugene Loh wrote: > Let's say you have multi-threaded MPI processes, you request > MPI_THREAD_MULTIPLE and get MPI_THREAD_MULTIPLE, and you use the self,sm,tcp > BTLs (which have some degree of threading support). Is it okay to have an > [MPI_Isend|MPI_Irecv] on one thread be completed by an MPI_Wait on another > thread? I'm assuming some sort of synchronization and memory barrier/flush > in between to protect against funny race conditions. > > If it makes things any easier on you, we can do this multiple-choice style: > > 1) Forbidden by the MPI standard. > 2) Not forbidden by the MPI standard, but will not work with OMPI (not even > with the BTLs that claim to be multi-threaded). > 3) Works well with OMPI (provided you use a BTL that's multi-threaded). I believe the current answer is #2, but it would be great if the answer could change to be a variant of #3: 3) Works well with OMPI (provided you use a BTL that's safe to use with MPI_THREAD_MULTIPLE) (i.e., the BTL doesn't have to be multi-threaded, itself) -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
Re: [OMPI users] multi-threaded programming
Durga Choudhury wrote: A follow-up question (and pardon if this sounds stupid) is this: If I want to make my process multithreaded, BUT only one thread has anything to do with MPI (for example, using OpenMP inside MPI), then the results will be correct EVEN IF #1 or #2 of Eugene holds true. Is this correct? I believe this is thoroughly covered by the standard (though I suppose the same could have been said about my question). In any case, for your situation, initialize MPI with MPI_Init_thread(). Ask for thread level MPI_THREAD_FUNNELED and check that that level is provided. That should cover your case. See the man page for MPI_Init_thread(). My question should not have anything to do with your case. On Tue, Mar 8, 2011 at 12:34 PM, Eugene Lohwrote: Let's say you have multi-threaded MPI processes, you request MPI_THREAD_MULTIPLE and get MPI_THREAD_MULTIPLE, and you use the self,sm,tcp BTLs (which have some degree of threading support). Is it okay to have an [MPI_Isend|MPI_Irecv] on one thread be completed by an MPI_Wait on another thread? I'm assuming some sort of synchronization and memory barrier/flush in between to protect against funny race conditions. If it makes things any easier on you, we can do this multiple-choice style: 1) Forbidden by the MPI standard. 2) Not forbidden by the MPI standard, but will not work with OMPI (not even with the BTLs that claim to be multi-threaded). 3) Works well with OMPI (provided you use a BTL that's multi-threaded). It's looking like #2 to me, but I'm not sure. ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users ___ users mailing list us...@open-mpi.org http://www.open-mpi.org/mailman/listinfo.cgi/users
Re: [OMPI users] multi-threaded programming
A follow-up question (and pardon if this sounds stupid) is this: If I want to make my process multithreaded, BUT only one thread has anything to do with MPI (for example, using OpenMP inside MPI), then the results will be correct EVEN IF #1 or #2 of Eugene holds true. Is this correct? Thanks Durga On Tue, Mar 8, 2011 at 12:34 PM, Eugene Lohwrote: > Let's say you have multi-threaded MPI processes, you request > MPI_THREAD_MULTIPLE and get MPI_THREAD_MULTIPLE, and you use the self,sm,tcp > BTLs (which have some degree of threading support). Is it okay to have an > [MPI_Isend|MPI_Irecv] on one thread be completed by an MPI_Wait on another > thread? I'm assuming some sort of synchronization and memory barrier/flush > in between to protect against funny race conditions. > > If it makes things any easier on you, we can do this multiple-choice style: > > 1) Forbidden by the MPI standard. > 2) Not forbidden by the MPI standard, but will not work with OMPI (not even > with the BTLs that claim to be multi-threaded). > 3) Works well with OMPI (provided you use a BTL that's multi-threaded). > > It's looking like #2 to me, but I'm not sure. > ___ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users >
[OMPI users] multi-threaded programming
Let's say you have multi-threaded MPI processes, you request MPI_THREAD_MULTIPLE and get MPI_THREAD_MULTIPLE, and you use the self,sm,tcp BTLs (which have some degree of threading support). Is it okay to have an [MPI_Isend|MPI_Irecv] on one thread be completed by an MPI_Wait on another thread? I'm assuming some sort of synchronization and memory barrier/flush in between to protect against funny race conditions. If it makes things any easier on you, we can do this multiple-choice style: 1) Forbidden by the MPI standard. 2) Not forbidden by the MPI standard, but will not work with OMPI (not even with the BTLs that claim to be multi-threaded). 3) Works well with OMPI (provided you use a BTL that's multi-threaded). It's looking like #2 to me, but I'm not sure.