<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The matched MPI Send/Recv pairs are mixed up in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069314#M4649</link>
    <description>&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Hi,&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Each MPI process has dedicated thread for each send/receive operation (I use MPI_Send/MPI_Recv calls). Because the data size is too big, I made each thread iterate over a for loop sending fixed sized data (a chunk) at a time.&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;My Expectation:&lt;/P&gt;

&lt;PRE style="padding: 5px; border: 0px currentColor; border-image: none; width: auto; color: rgb(36, 39, 41); overflow: auto; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-top: 0px; margin-bottom: 1em; -ms-word-wrap: normal; max-height: 600px; background-color: rgb(239, 240, 241);"&gt;&lt;CODE style="margin: 0px; padding: 0px; border: 0px currentColor; border-image: none; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; white-space: inherit;"&gt; SendThread (rank 0)    ReceiveThread (rank 1)
         chunk&lt;I&gt;    -&amp;gt;       chunk&lt;I&gt;
         chunk[i+1]  -&amp;gt;       chunk[i+1]
                     ...
&lt;/I&gt;&lt;/I&gt;&lt;/CODE&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Actually what happened is that:&lt;/P&gt;

&lt;PRE style="padding: 5px; border: 0px currentColor; border-image: none; width: auto; color: rgb(36, 39, 41); overflow: auto; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-top: 0px; margin-bottom: 1em; -ms-word-wrap: normal; max-height: 600px; background-color: rgb(239, 240, 241);"&gt;&lt;CODE style="margin: 0px; padding: 0px; border: 0px currentColor; border-image: none; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; white-space: inherit;"&gt; SendThread (rank 0)    ReceiveThread (rank 1)
         chunk&lt;I&gt;    -&amp;gt;       chunk[i+1]
         chunk[i+1]  -&amp;gt;       chunk&lt;I&gt;
                     ...
&lt;/I&gt;&lt;/I&gt;&lt;/CODE&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;The data of chunk&lt;I&gt; on the sender side has sent to&lt;/I&gt;&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;How can this happen? AFAIK, MPI_Send/Recv call is blocking call that can not progress unless there is any matched call (Send &amp;lt;---&amp;gt; Recv).&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Does it mean that Sending chunk&lt;I&gt; has been matched with Receiving chunk&lt;I&gt;, but when the data is actually being delivered they got screwed up?&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Is it expected behavior? thanks,&lt;/P&gt;</description>
    <pubDate>Sun, 30 Oct 2016 02:40:52 GMT</pubDate>
    <dc:creator>seongyun_k_</dc:creator>
    <dc:date>2016-10-30T02:40:52Z</dc:date>
    <item>
      <title>The matched MPI Send/Recv pairs are mixed up</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069314#M4649</link>
      <description>&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Hi,&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Each MPI process has dedicated thread for each send/receive operation (I use MPI_Send/MPI_Recv calls). Because the data size is too big, I made each thread iterate over a for loop sending fixed sized data (a chunk) at a time.&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;My Expectation:&lt;/P&gt;

&lt;PRE style="padding: 5px; border: 0px currentColor; border-image: none; width: auto; color: rgb(36, 39, 41); overflow: auto; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-top: 0px; margin-bottom: 1em; -ms-word-wrap: normal; max-height: 600px; background-color: rgb(239, 240, 241);"&gt;&lt;CODE style="margin: 0px; padding: 0px; border: 0px currentColor; border-image: none; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; white-space: inherit;"&gt; SendThread (rank 0)    ReceiveThread (rank 1)
         chunk&lt;I&gt;    -&amp;gt;       chunk&lt;I&gt;
         chunk[i+1]  -&amp;gt;       chunk[i+1]
                     ...
&lt;/I&gt;&lt;/I&gt;&lt;/CODE&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Actually what happened is that:&lt;/P&gt;

&lt;PRE style="padding: 5px; border: 0px currentColor; border-image: none; width: auto; color: rgb(36, 39, 41); overflow: auto; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin-top: 0px; margin-bottom: 1em; -ms-word-wrap: normal; max-height: 600px; background-color: rgb(239, 240, 241);"&gt;&lt;CODE style="margin: 0px; padding: 0px; border: 0px currentColor; border-image: none; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; white-space: inherit;"&gt; SendThread (rank 0)    ReceiveThread (rank 1)
         chunk&lt;I&gt;    -&amp;gt;       chunk[i+1]
         chunk[i+1]  -&amp;gt;       chunk&lt;I&gt;
                     ...
&lt;/I&gt;&lt;/I&gt;&lt;/CODE&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;The data of chunk&lt;I&gt; on the sender side has sent to&lt;/I&gt;&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;How can this happen? AFAIK, MPI_Send/Recv call is blocking call that can not progress unless there is any matched call (Send &amp;lt;---&amp;gt; Recv).&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Does it mean that Sending chunk&lt;I&gt; has been matched with Receiving chunk&lt;I&gt;, but when the data is actually being delivered they got screwed up?&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P style="border: 0px currentColor; border-image: none; color: rgb(36, 39, 41); clear: both; font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em;"&gt;Is it expected behavior? thanks,&lt;/P&gt;</description>
      <pubDate>Sun, 30 Oct 2016 02:40:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069314#M4649</guid>
      <dc:creator>seongyun_k_</dc:creator>
      <dc:date>2016-10-30T02:40:52Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069315#M4650</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;This is the C++ compiler forum.&lt;/P&gt;

&lt;P&gt;I think this question would be more appropriate here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology"&gt;https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2016 15:01:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069315#M4650</guid>
      <dc:creator>Judith_W_Intel</dc:creator>
      <dc:date>2016-10-31T15:01:45Z</dc:date>
    </item>
    <item>
      <title>You're a little off with how</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069316#M4651</link>
      <description>&lt;P&gt;You're a little off with how MPI_Send and MPI_Recv work.&amp;nbsp; By default, MPI_Send only needs to copy the data (and a few other things) somewhere safe before returning.&amp;nbsp; Different implementations can handle this in different manners.&amp;nbsp; One variant of MPI_Send is MPI_Ssend.&amp;nbsp; This is a synchronous send, and will not return until the matching MPI_Recv occurs.&amp;nbsp; That is not forced in the Intel® MPI Library.&amp;nbsp; Intel MPI uses a buffered send, which copies the data to a buffer for communication later, and will return once the data is ready for a later MPI_Recv call.&amp;nbsp; If you need to force the synchronous behavior, use MPI_Ssend instead of MPI_Send.&lt;/P&gt;

&lt;P&gt;However, for performance reasons, I recommend sticking with MPI_Send and using tags to differentiate each message.&amp;nbsp; If you assign a unique tag for each send/receive pair, this will force the pairs to match.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 20:19:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/The-matched-MPI-Send-Recv-pairs-are-mixed-up/m-p/1069316#M4651</guid>
      <dc:creator>James_T_Intel</dc:creator>
      <dc:date>2016-11-23T20:19:27Z</dc:date>
    </item>
  </channel>
</rss>

