using buffered send and non blocking send I was wondering how and if they implement a new level of parallelism in my application eventually generating a thread. Imagine that a slave process generates a large amount of data and want to send it to the master. My idea was to start a buffered or non blocking send then immediately begin to compute the next result.
Just when I would have to send the new data I wold check if I can reuse the buffer. This would introduce a new开发者_如何学Python level of parallelism in my application between CPU and communication. Does anybody knows how this is done in MPI ? Does MPI generate a new thread to handle the Bsend or Isend ? Thanks.
What you're looking for is a nonblocking send using your own buffer (MPI_Isend
).There is no need to worry about threading -- ISend
should return immediately to let you continue your own code. You would then continue your work, and post an MPI_Wait
request on the MPI_Request
that you passed to Isend
. This will then block until the buffer is free to use again. If you have space for several buffers, you could improve parallelism by allocating several buffers and using whichever becomes available through MPI_Waitany
.
精彩评论