<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Hello,<div><br></div><div>I have a use-case where I need to transmit an Array of Structures (AoS) among a group of processors in a circular ("ring") fashion.</div><div>I do that currently by using a non-blocking send and receive, and using two auxiliary buffers on the senders and receivers side respectively.</div><div><br></div><div>Since the data I am transferring is extremely huge (~60 gb before partitioning), allocating two buffers seems inefficient to me. My question is -- Is there a better way to do it by avoiding "two buffers"? (Perhaps just using one buffer in some way?).</div><div><br></div><div>Roughly my communication procedure looks like this:</div><div><div><br></div><div>//Pack AoS into send buffer (which is a vector<char>) </div><div> char *msg_ptr = &(msg_send_buf_.front());</div><div> for (auto& param : local_primal_params_) {</div><div> param.pack_to(msg_ptr);</div><div> msg_ptr += PARAM_BYTENUM;</div><div> }</div><div><br></div><div>//Perform non-blocking send receive<br></div><div> {</div><div> MPI_Request send_request;</div><div> MPI_Status send_stat, recv_stat;</div><div> MPI_Isend(&(msg_send_buf_.front()), local_primal_params_.size() * PARAM_BYTENUM, MPI_CHAR,</div><div> send_to, 0,</div><div> MPI_COMM_WORLD, &send_request);</div><div> MPI_Recv(&(msg_recv_buf_.front()), local_primal_params_.size() * PARAM_BYTENUM, MPI_CHAR,</div><div> recv_from, 0,</div><div> MPI_COMM_WORLD, &recv_stat);</div><div> MPI_Wait(&send_request, &send_stat);</div><div> }</div><div><br></div><div>//Unpack receive buffer back into AoS on receiver side<br></div><div> {</div><div> char *msg_ptr = &(msg_recv_buf_.front());</div><div> for (auto& param : local_primal_params_) {</div><div> param.unpack_from(msg_ptr);</div><div> msg_ptr += PARAM_BYTENUM;</div><div> }</div><div> }</div></div><div><div><br></div><div>Any recommendations will be very helpful.</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Thanks,</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">params</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><a href="http://people.ucsc.edu/~praman1/">http://people.ucsc.edu/~praman1/</a><br></span></font></div></div></div>
</div></div>