Dear all, Dear Jeff, I have three communicator: the standard one: MPI_COMM_WORLD
and other two: MPI_LOCAL_COMM MPI_MASTER_COMM a sort of two-level MPI. Suppose to have 8 threats, I use 4 threats for run the same problem with different value. These are the LOCAL_COMM. In addition I have a MPI_MASTER_COMM to allow the master of each group to communicate. These give me some problem. For example, I have to exit to a cycle, according to a check: IF(counter.GE.npercstop*nParticles)THEN flag2exit=1 WRITE(*,*) '-Warning PSO has been exit' EXIT pso_cycle ENDIF But this is difficult to do since I have to exit only after all the threats inside a set have finish their task. Do you have some suggestions? Do you need other information? Really Really thanks Diego On 11 August 2018 at 14:03, Jeff Squyres (jsquyres) <jsquy...@cisco.com> wrote: > On Aug 10, 2018, at 6:27 PM, Diego Avesani <diego.aves...@gmail.com> > wrote: > > > > The question is: > > Is it possible to have a barrier for all CPUs despite they belong to > different group? > > If the answer is yes I will go in more details. > > By "CPUs", I assume you mean "MPI processes", right? (i.e., not threads > inside an individual MPI process) > > Again, this is not quite a specific-enough question. Do the different > groups (and I assume you really mean communicators) overlap? Are they > disjoint? Is there a reason MPI_COMM_WORLD is not sufficient? > > There are two typical ways to barrier a set of MPI processes. > > 1. Write your own algorithm to do sends / receives -- and possibly even > collectives -- to ensure that no process leaves the barrier before every > process enters the barrier. > > 2. Make sure that you have a communicator that includes exactly the set of > processes that you want (and if you don't have a communicator fitting this > description, make one), and then call MPI_BARRIER on it. > > #2 is typically the easier solution. > > -- > Jeff Squyres > jsquy...@cisco.com > >
_______________________________________________ users mailing list users@lists.open-mpi.org https://lists.open-mpi.org/mailman/listinfo/users