<?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 MPI_Recv Hangs While Receiving Large Array in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/MPI-Recv-Hangs-While-Receiving-Large-Array/m-p/1089529#M5029</link>
    <description>&lt;P&gt;&lt;SPAN style="color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px;"&gt;I'm noticing some strange behaviour with a very simple piece of MPI code:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;mpi.h&amp;gt;

int main(int argc, char* argv[])
{
    // Initialize the MPI environment
    MPI_Init(NULL, NULL);

    int world_rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;world_rank);
    int world_size;
    MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;world_size);

    // We are assuming at least 2 processes for this task
    if (world_size != 2)
    {
        std::cout &amp;lt;&amp;lt; "World size must be equal to 1" &amp;lt;&amp;lt; std::endl;
        MPI_Abort(MPI_COMM_WORLD, 1);
    }

    int numberCounter = 10000;
    double number[numberCounter];

    if (world_rank == 0)
    {
        std::cout &amp;lt;&amp;lt; world_rank &amp;lt;&amp;lt; std::endl;
        MPI_Send(number, numberCounter, MPI_DOUBLE, 1, 0, MPI_COMM_WORLD);
    }
    else if (world_rank == 1)
    {
        std::cout &amp;lt;&amp;lt; world_rank &amp;lt;&amp;lt; std::endl;
        MPI_Recv(number, numberCounter, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
    }

    MPI_Finalize();
}&lt;/PRE&gt;

&lt;P style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;The above works fine provided that&amp;nbsp;&lt;CODE style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; 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; background-color: rgb(239, 240, 241); white-space: pre-wrap;"&gt;numberCounter&lt;/CODE&gt;&amp;nbsp;is small (~1000). When the value is larger however (&amp;gt;10000), the code hangs and never reaches the end. I checked with MPI_Iprobe and it does show that rank 1 is receiving a message, but MPI_Recv always hangs.&lt;/P&gt;

&lt;P style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;What could be causing this? Can anyone else reproduce this behaviour?&lt;/P&gt;

&lt;P style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;[EDIT] I'm not sure how I missed this, but this seems to be a duplicate of &amp;nbsp;https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology/topic/607259 [/EDIT]&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2017 09:41:10 GMT</pubDate>
    <dc:creator>Simon_B_1</dc:creator>
    <dc:date>2017-02-07T09:41:10Z</dc:date>
    <item>
      <title>MPI_Recv Hangs While Receiving Large Array</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/MPI-Recv-Hangs-While-Receiving-Large-Array/m-p/1089529#M5029</link>
      <description>&lt;P&gt;&lt;SPAN style="color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif; font-size: 15px;"&gt;I'm noticing some strange behaviour with a very simple piece of MPI code:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;mpi.h&amp;gt;

int main(int argc, char* argv[])
{
    // Initialize the MPI environment
    MPI_Init(NULL, NULL);

    int world_rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;world_rank);
    int world_size;
    MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;world_size);

    // We are assuming at least 2 processes for this task
    if (world_size != 2)
    {
        std::cout &amp;lt;&amp;lt; "World size must be equal to 1" &amp;lt;&amp;lt; std::endl;
        MPI_Abort(MPI_COMM_WORLD, 1);
    }

    int numberCounter = 10000;
    double number[numberCounter];

    if (world_rank == 0)
    {
        std::cout &amp;lt;&amp;lt; world_rank &amp;lt;&amp;lt; std::endl;
        MPI_Send(number, numberCounter, MPI_DOUBLE, 1, 0, MPI_COMM_WORLD);
    }
    else if (world_rank == 1)
    {
        std::cout &amp;lt;&amp;lt; world_rank &amp;lt;&amp;lt; std::endl;
        MPI_Recv(number, numberCounter, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
    }

    MPI_Finalize();
}&lt;/PRE&gt;

&lt;P style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;The above works fine provided that&amp;nbsp;&lt;CODE style="margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; 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; background-color: rgb(239, 240, 241); white-space: pre-wrap;"&gt;numberCounter&lt;/CODE&gt;&amp;nbsp;is small (~1000). When the value is larger however (&amp;gt;10000), the code hangs and never reaches the end. I checked with MPI_Iprobe and it does show that rank 1 is receiving a message, but MPI_Recv always hangs.&lt;/P&gt;

&lt;P style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;What could be causing this? Can anyone else reproduce this behaviour?&lt;/P&gt;

&lt;P style="margin-bottom: 1em; border: 0px; font-size: 15px; clear: both; color: rgb(36, 39, 41); font-family: Arial, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, sans-serif;"&gt;[EDIT] I'm not sure how I missed this, but this seems to be a duplicate of &amp;nbsp;https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology/topic/607259 [/EDIT]&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 09:41:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/MPI-Recv-Hangs-While-Receiving-Large-Array/m-p/1089529#M5029</guid>
      <dc:creator>Simon_B_1</dc:creator>
      <dc:date>2017-02-07T09:41:10Z</dc:date>
    </item>
  </channel>
</rss>

