Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] How to create multi-thread parallel program using thread-safe send and recv?
From: Eugene Loh (Eugene.Loh_at_[hidden])
Date: 2009-09-27 17:00:00

guosong wrote:
I used MPI_Init_thread(&argc,&argv, MPI_THREAD_MULTIPLE, &provided); in my program and got provided = 0 which turns out to be the MPI_THREAD_SINGLE. Does this mean that I can not use MPI_THREAD_MULTIPLE model?
Right.  I've not done much multithreaded MPI work.  Someone else on this list can advise you better what you need to do to get provided=MPI_THREAD_MULTIPLE.
I write a little program to test the multithreading and it worked sometimes and failed sometimes. It also hang there sometimes. Does this only because the MPI_THREAD_MULTIPLE is not supported or there are some bugs in the program?
I don't know if there are bugs in the program, but without the MPI threads support you can't really test it. 
BTW, if I want to create a background thread which is sort of like a deamon thread, how can I achieve that in MPI programs? Thanks.
I'm not sure I understand the question.  Creating a background thread isn't part of MPI.  You would use something else, like POSIX threads or OpenMP.