Re: [OMPI users] Groups and Communicators

2017-08-02 Thread George Bosilca
I was commenting on one of Diego's previous solutions where all non-master processes were using the color set to MPI_COMM_NULL in MPI_COMM_SPLIT. Overall comparing with MPI_COMM_NULL as you suggested is indeed the cleanest solution. George. On Wed, Aug 2, 2017 at 1:36 PM, Jeff Squyres (jsquyr

Re: [OMPI users] Groups and Communicators

2017-08-02 Thread Jeff Squyres (jsquyres)
George -- Just to be clear, I was not suggesting that he split on a color of MPI_COMM_NULL. His last snippet of code was: - CALL MPI_GROUP_INCL(GROUP_WORLD, nPSObranch, MRANKS, MASTER_GROUP,ierr) CALL MPI_COMM_CREATE_GROUP(MPI_COMM_WORLD,MASTER_GROUP,0,MASTER_COMM,iErr) ! IF(MPI_COMM_NU

Re: [OMPI users] Groups and Communicators

2017-08-02 Thread George Bosilca
Diego, Setting the color to MPI_COMM_NULL is not good, as it results in some random value (and not the MPI_UNDEFINED that do not generate a communicator). Change the color to MPI_UNDEFINED and your application should work just fine (in the sense that all processes not in the master communicator wi

Re: [OMPI users] Groups and Communicators

2017-08-02 Thread Diego Avesani
Dear Jeff, Dear all, thanks, I will try immediately. thanks again Diego On 2 August 2017 at 14:01, Jeff Squyres (jsquyres) wrote: > Just like in your original code snippet, you can > > If (master_comm .ne. Mpi_comm_null) then >... > > Sent from my phone. No type good. > > On Aug 2, 201

Re: [OMPI users] Groups and Communicators

2017-08-02 Thread Jeff Squyres (jsquyres)
Just like in your original code snippet, you can If (master_comm .ne. Mpi_comm_null) then ... Sent from my phone. No type good. On Aug 2, 2017, at 7:17 AM, Diego Avesani mailto:diego.aves...@gmail.com>> wrote: Dear all, Dear Jeff, I am very sorry, but I do not know how to do this kind of c

Re: [OMPI users] Groups and Communicators

2017-08-02 Thread Diego Avesani
Dear all, Dear Jeff, I am very sorry, but I do not know how to do this kind of comparison. this is my peace of code: CALL MPI_GROUP_INCL(GROUP_WORLD, nPSObranch, MRANKS, MASTER_GROUP,ierr) CALL MPI_COMM_CREATE_GROUP(MPI_COMM_WORLD,MASTER_GROUP,0,MASTER_COMM,iErr) ! IF(MPI_COMM_NULL .NE. MASTE

Re: [OMPI users] Groups and Communicators

2017-08-01 Thread Jeff Squyres (jsquyres)
On Aug 1, 2017, at 5:56 AM, Diego Avesani wrote: > > If I do this: > > CALL MPI_SCATTER(PP, npart, MPI_DOUBLE, PPL, 10,MPI_DOUBLE, 0, MASTER_COMM, > iErr) > > I get an error. This because some CPU does not belong to MATER_COMM. The > alternative should be: > > IF(rank.LT.0)THEN > CALL MP

Re: [OMPI users] Groups and Communicators

2017-08-01 Thread Diego Avesani
Dear all, Dear George, now it seems getting better: * CALL MPI_GROUP_INCL(GROUP_WORLD, nPSObranch, MRANKS, MASTER_GROUP,ierr)* * !!Create a new communicator based on the group* * CALL MPI_COMM_CREATE_GROUP(MPI_COMM_WORLD,MASTER_GROUP,0,MASTER_COMM,iErr)* * IF(MPI_COMM_NULL .NE. MASTER_COMM)THEN*

Re: [OMPI users] Groups and Communicators

2017-07-28 Thread Diego Avesani
Dear George, Dear all, I have just rewritten the code to make it more clear: * INTEGER :: colorl,colorglobal* * INTEGER :: LOCAL_COMM,MASTER_COMM* * !* * !---* * ! create WORLD comm

Re: [OMPI users] Groups and Communicators

2017-07-28 Thread Diego Avesani
Dear George, Dear all, here the code: PROGRAM TEST USE MPI IMPLICIT NONE ! mpif90 -r8 *.f90 ! INTEGER :: rank INTEGER :: subrank,leader_rank INTEGER :: nCPU INTEGER :: subnCPU INTEGER :: ierror INTEGER :: tag

Re: [OMPI users] Groups and Communicators

2017-07-28 Thread George Bosilca
I guess the second comm_rank call is invalid on all non-leader processes, as their LEADER_COMM communicator is MPI_COMM_NULL. george On Fri, Jul 28, 2017 at 05:06 Diego Avesani wrote: > Dear George, Dear all, > > thanks, thanks a lot. I will tell you everything. > I will try also to implement y

Re: [OMPI users] Groups and Communicators

2017-07-28 Thread Diego Avesani
Dear George, Dear all, thanks, thanks a lot. I will tell you everything. I will try also to implement your suggestion. Unfortunately, the program that I have show to you is not working. I get the following error: [] *** An error occurred in MPI_Comm_rank [] *** reported by process [643497985,7]

Re: [OMPI users] Groups and Communicators

2017-07-27 Thread George Bosilca
This looks good. If performance is critical you can speed up the entire process by using MPI_Comm_create_group instead of the second MPI_COMM_SPLIT. The MPI_Comm_create_group is collective only over the resulting communicator and not over the source communicator, so its cost is only dependent of th

Re: [OMPI users] Groups and Communicators

2017-07-27 Thread Diego Avesani
Dear George, Dear all, I have tried to create a simple example. In particular, I would like to use 16 CPUs and to create four groups according to rank is and then a communicator between masters of each group.I have tried to follow the first part of this example

Re: [OMPI users] Groups and Communicators

2017-07-27 Thread Diego Avesani
Dear George, Dear all, A question regarding program design: The draft that I have sent to you has to be done many and many times. Does the splitting procedure ensure efficiency? I will try, at a lest to create groups and split them. I am a beginner in the MPI groups environment. really, really th

Re: [OMPI users] Groups and Communicators

2017-07-26 Thread George Bosilca
Diego, As all your processes are started under the umbrella of a single mpirun, they have a communicator in common, the MPI_COMM_WORLD. One possible implementation, using MPI_Comm_split, will be the following: MPI_Comm small_comm, leader_comm; /* Create small_comm on all processes */ /* Now us

Re: [OMPI users] Groups and Communicators

2017-07-26 Thread Diego Avesani
Dear George, Dear all, I use "mpirun -np xx ./a.out" I do not know if I have some common grounds. I mean, I have to design everything from the begging. You can find what I would like to do in the attachment. Basically, an MPI cast in another MPI. Consequently, I am thinking to MPI groups or MPI

Re: [OMPI users] Groups and Communicators

2017-07-25 Thread George Bosilca
Diego, Assuming you have some common grounds between the 4 initial groups (otherwise you will have to connect them via MPI_Comm_connect/MPI_Comm_accept) you can merge the 4 groups together and then use any MPI mechanism to create a partial group of leaders (such as MPI_Comm_split). If you spawn

[OMPI users] Groups and Communicators

2017-07-25 Thread Diego Avesani
Dear All, I am studying Groups and Communicators, but before start going in detail, I have a question about groups. I would like to know if is it possible to create a group of masters of the other groups and then a intra-communication in the new group. I have spent sometime reading different tuto