On Sep 30, 2015, at 4:41 PM, Diego Avesani <diego.aves...@gmail.com> wrote: > > Dear Gilles, > sorry to ask you again and to be frustrating, > basically is this what I shall do for each CPU: > > CALL MPI_ISEND(send_messageL, MsgLength, MPI_DOUBLE_COMPLEX, MPIdata%rank-1, > MPIdata%rank, MPI_COMM_WORLD, REQUEST(1), MPIdata%iErr) > > > CALL MPI_IRECV(recv_messageR, MsgLength, MPI_DOUBLE_COMPLEX, MPIdata%rank+1, > MPIdata%rank+1, MPI_COMM_WORLD, REQUEST(2), MPIdata%iErr) > > and then > > CALL MPI_WAITALL(nMsg,REQUEST(1:2),send_status_list,MPIdata%iErr)
Per my prior email: what is the value of nMsg? If it's 2, you should probably be ok. > On 30 September 2015 at 12:42, Jeff Squyres (jsquyres) <jsquy...@cisco.com> > wrote: > Put differently: > > - You have an array of N requests > - If you're only filling up M of them (where N<M) > - And then you pass the whole array of size N to MPI > - Then N-M of them will have garbage values (unless you initialize them to > MPI_REQUEST_NULL) > - And MPI's behavior with garbage values will be unpredictable / undefined > > You can either pass M (i.e., the number of requests that you have *actually* > filled) to MPI, or you can ensure that the N-M unused requests in the array > are filled with MPI_REQUEST_NULL (which MPI_WAITANY and friends will safely > ignore). One way of doing the latter is initializing the entire array with > MPI_REQUEST_NULL and then only filling in the M entries with real requests. > > It seems much simpler / faster to just pass in M to MPI_WAITANY (any > friends), not N. -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/