[mpi] what is the equivalent of MPI_COMM_SELF?
Is there something equivalent to the constant MPI_COMM_SELF in Boost.MPI? It is easy to refer the MPI_COMM_WORLD since this is the default constructor of boost::mpi::communicator, but it seems that the only way to have the equivalent of MPI_COMM_SELF is to do boost::mpi::communicator self(MPI_COMM_SELF, boost::mpi::communicator::comm_attach); does it make sense to define a global object with that name to refer to the communicator in current process? (this can be handy to switch to serial bahavior and parallel executrion when debugging the code, I guess). Thanks, Alfredo
On Aug 11, 2009, at 5:55 PM, alfC wrote:
Is there something equivalent to the constant MPI_COMM_SELF in Boost.MPI?
It is easy to refer the MPI_COMM_WORLD since this is the default constructor of boost::mpi::communicator, but it seems that the only way to have the equivalent of MPI_COMM_SELF is to do
boost::mpi::communicator self(MPI_COMM_SELF, boost::mpi::communicator::comm_attach);
does it make sense to define a global object with that name to refer to the communicator in current process? (this can be handy to switch to serial bahavior and parallel executrion when debugging the code, I guess).
Do you need this regularly? I have never seen any need for this before. Have you have a real need? Matthias
Do you need this regularly? I have never seen any need for this before. Have you have a real need?
I just started using both MPI and Boost.MPI so I don't know, and most of the use is only investigative. I just found that sometimes replacing "world" by "self" can change from parallel syncronized behavior to unsyncronized behavior very easily, for example when debugging. here it is an example in which just changing WORLD by SELF changes de behavior of the program: https://computation.llnl.gov/casc/ppf/ppf.html But maybe you are right, maybe there is no real need and I can live without it. I noticed that world and self (or null) are treated asymmetrically in the Boost.MPI syntax. just that. Alfredo
On Aug 12, 2009, at 2:41 PM, Alfredo Correa wrote:
Do you need this regularly? I have never seen any need for this before. Have you have a real need?
I just started using both MPI and Boost.MPI so I don't know, and most of the use is only investigative. I just found that sometimes replacing "world" by "self" can change from parallel syncronized behavior to unsyncronized behavior very easily, for example when debugging.
here it is an example in which just changing WORLD by SELF changes de behavior of the program: https://computation.llnl.gov/casc/ppf/ppf.html
But maybe you are right, maybe there is no real need and I can live without it. I noticed that world and self (or null) are treated asymmetrically in the Boost.MPI syntax. just that.
I never saw any need for using MPI_COMM_SELF in many years of parallel programming. When I want to debug using one process I just start the program using one process only. As you write yourself, it is trivial to construct a communicator based on MPI_COMM_SELF - a single line. Furthermore you don't even need MPI_COMM_SELF. Even the MPI manual states that MPI_COMM_SELF is just convenience. Unless I see real demand I hesitate to add something to the library for which I have never seen any use in a real application. Matthias
participants (3)
-
alfC
-
Alfredo Correa
-
Matthias Troyer