<?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 Re:Inconsistent file content between runs with MPI_File_write in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1320001#M8812</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We tried running your code and it is working fine at our end.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So, could you please provide the following details to investigate more on your issue?&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The version of OS being used.&lt;/LI&gt;&lt;LI&gt;The number of nodes being used to launch the MPI job (whether using a multi-node/ single-node environment).&lt;/LI&gt;&lt;LI&gt;The hardware you are using(ex: Infiniband/ Omnipath).&lt;/LI&gt;&lt;LI&gt;The FI_PROVIDER(ex: mlx/psm2) you are using.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 07 Oct 2021 12:00:14 GMT</pubDate>
    <dc:creator>SantoshY_Intel</dc:creator>
    <dc:date>2021-10-07T12:00:14Z</dc:date>
    <item>
      <title>Inconsistent file content between runs with MPI_File_write</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1319848#M8811</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;cmath&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;

#include "mpi.h"

template &amp;lt;typename DT&amp;gt;
inline DT **createC(int m, int n) {
  DT **array = new DT *[m];
  *array = new DT[m * n];
  for (int i = 1; i &amp;lt; m; ++i) {
    array[i] = array[i - 1] + n;
  }
  return array;
}

template &amp;lt;typename DT&amp;gt;
inline void freeC(DT **array) {
  if (array) {
    if (array[0]) delete[] array[0];
    delete[] array;
  }
}

int main(int argc, char **argv) {
  int rank, size;
  MPI_File fhw;
  MPI_Status status;
  MPI_Offset offset;
  MPI_Init(&amp;amp;argc, &amp;amp;argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &amp;amp;rank);
  MPI_Comm_size(MPI_COMM_WORLD, &amp;amp;size);

  const int nvar = 3;
  const int nx = rank + 5;
  double **buf = createC&amp;lt;double&amp;gt;(nx, nvar);
  for (int i = 0; i &amp;lt; nx; ++i) {
    for (int ivar = 0; ivar &amp;lt; nvar; ++ivar) {
      buf[i][ivar] = 100 * rank + 1.0 * i + 0.1 * ivar;
    }
  }

  // disp of buf[0][0]
  int proc_disp = 0;
  if (rank != 0)
    MPI_Recv(&amp;amp;proc_disp, 1, MPI_INT, rank - 1, 0, MPI_COMM_WORLD,
             MPI_STATUS_IGNORE);
  int next_disp = proc_disp + nx * sizeof(double);
  if (rank &amp;lt; size - 1)
    MPI_Send(&amp;amp;next_disp, 1, MPI_INT, rank + 1, 0, MPI_COMM_WORLD);

  int nx_total;
  MPI_Allreduce(&amp;amp;nx, &amp;amp;nx_total, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);

  MPI_Aint sizeofdouble, lb;
  MPI_Type_get_extent(MPI_DOUBLE, &amp;amp;lb, &amp;amp;sizeofdouble);

  MPI_Datatype col, col_memory;
  MPI_Type_vector(nx, 1, nvar, MPI_DOUBLE, &amp;amp;col);
  MPI_Type_create_resized(col, lb, sizeofdouble, &amp;amp;col_memory);
  MPI_Type_commit(&amp;amp;col_memory);

  MPI_Datatype col_file, ftype;
  MPI_Type_vector(1, nx, nx_total, MPI_DOUBLE, &amp;amp;col_file);
  MPI_Type_create_resized(col_file, 0, nx_total * sizeofdouble, &amp;amp;ftype);
  MPI_Type_commit(&amp;amp;ftype);
  
  std::string file = "test2.bin";
  MPI_File_open(MPI_COMM_WORLD, (char *)file.c_str(),MPI_MODE_CREATE	|	MPI_MODE_WRONLY, MPI_INFO_NULL, &amp;amp;fhw);
  MPI_Offset f_offset = proc_disp;
  MPI_File_set_view(fhw, f_offset, MPI_DOUBLE, ftype, "native", MPI_INFO_NULL);
  MPI_File_write(fhw, &amp;amp;buf[0][0], nvar, col_memory, MPI_STATUS_IGNORE);
  
  MPI_File_close(&amp;amp;fhw);
  MPI_Type_free(&amp;amp;col_memory);
  MPI_Type_free(&amp;amp;ftype);

  freeC(buf);
  MPI_Finalize();

  return 0;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The aim of the program is to transpose matrix &lt;STRONG&gt;buf&lt;/STRONG&gt; and write it to the file. The final matrix in the file should have a shape of &lt;STRONG&gt;nvar * nx_total.&amp;nbsp;&lt;/STRONG&gt;I'm using mpiicpc with icpc (ICC) 2021.4.0 20210910,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I run the program with&amp;nbsp;&lt;STRONG&gt;mpiexec -np 4 ./test.x&lt;/STRONG&gt;,&amp;nbsp; an objdump of the file with &lt;STRONG&gt;od -t f8 -w80 test2.bin&amp;nbsp;&lt;/STRONG&gt;sometime shows the following results ( the result looks different for every run):&lt;/P&gt;
&lt;P&gt;0000000 0 1 2 3 4 &lt;STRONG&gt;0 0 0 0 0&lt;/STRONG&gt;&lt;BR /&gt;0000120 &lt;STRONG&gt;0&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200 201 202 203 204 205 206 300 301&lt;BR /&gt;0000240 302&amp;nbsp; &amp;nbsp;303 304 305 306 307 &lt;STRONG&gt;-nan -nan -nan -nan&lt;/STRONG&gt;&lt;BR /&gt;0000360 &lt;STRONG&gt;-nan -nan -nan -nan -nan -nan -nan&lt;/STRONG&gt; 200.1 201.1 202.1&lt;BR /&gt;0000500 203.1 204.1 205.1 206.1 300.1 301.1 302.1 303.1 304.1 305.1&lt;BR /&gt;0000620 306.1 307.1&lt;STRONG&gt; -nan -nan -nan -nan -nan -nan -nan -nan&lt;/STRONG&gt;&lt;BR /&gt;0000740 &lt;STRONG&gt;-nan -nan -nan&lt;/STRONG&gt; 200.2 201.2 202.2 203.2 204.2 205.2 206.2&lt;BR /&gt;0001060 300.2 301.2 302.2 303.2 304.2 305.2 306.2 307.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I expect the results should be like the following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0000000 0 1 2 3 4 &lt;STRONG&gt;100 101 102 103 104&lt;/STRONG&gt;&lt;BR /&gt;0000120 &lt;STRONG&gt;105&lt;/STRONG&gt; 200 201 202 203 204 205 206 300 301&lt;BR /&gt;0000240 302 303 304 305 306 307 &lt;STRONG&gt;0.1 1.1 2.1 3.1&lt;/STRONG&gt;&lt;BR /&gt;0000360 &lt;STRONG&gt;4.1 100.1 101.1 102.1 103.1 104.1 105.1&lt;/STRONG&gt; 200.1 201.1 202.1&lt;BR /&gt;0000500 203.1 204.1 205.1 206.1 300.1 301.1 302.1 303.1 304.1 305.1&lt;BR /&gt;0000620 306.1 307.1 &lt;STRONG&gt;0.2 1.2 2.2 3.2 4.2 100.2 101.2 102.2&lt;/STRONG&gt;&lt;BR /&gt;0000740 &lt;STRONG&gt;103.2 104.2 105.2&lt;/STRONG&gt; 200.2 201.2 202.2 203.2 204.2 205.2 206.2&lt;BR /&gt;0001060 300.2 301.2 302.2 303.2 304.2 305.2 306.2 307.2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I replace&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;MPI_File_write by&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;MPI_File_write_all, I can get desired results. OpenMPI doesn't reproduce the problem.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 15:45:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1319848#M8811</guid>
      <dc:creator>Mach</dc:creator>
      <dc:date>2021-10-07T15:45:51Z</dc:date>
    </item>
    <item>
      <title>Re:Inconsistent file content between runs with MPI_File_write</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1320001#M8812</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We tried running your code and it is working fine at our end.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So, could you please provide the following details to investigate more on your issue?&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The version of OS being used.&lt;/LI&gt;&lt;LI&gt;The number of nodes being used to launch the MPI job (whether using a multi-node/ single-node environment).&lt;/LI&gt;&lt;LI&gt;The hardware you are using(ex: Infiniband/ Omnipath).&lt;/LI&gt;&lt;LI&gt;The FI_PROVIDER(ex: mlx/psm2) you are using.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:00:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1320001#M8812</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2021-10-07T12:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Inconsistent file content between runs with MPI_File_write</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1320054#M8815</link>
      <description>&lt;P&gt;My development environment where I encountered the problem:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Windows 10 Enterprise 10.0.18363 Build 18363&lt;BR /&gt;windows subsystem for linux 1&lt;BR /&gt;Distributor ID: Ubuntu&lt;BR /&gt;Description: Ubuntu 20.04.3 LTS&lt;BR /&gt;Release: 20.04&lt;BR /&gt;Codename: focal&lt;/LI&gt;
&lt;LI&gt;Program is compiled as&amp;nbsp;&lt;STRONG&gt;mpiicpc main.cpp -o test&lt;/STRONG&gt;,&amp;nbsp; run as&amp;nbsp;&lt;STRONG&gt;mpiexec -np 4 ./test&lt;BR /&gt;which mpiicpc&lt;/STRONG&gt; -&amp;gt; /opt/intel/oneapi/mpi/latest//bin/mpiicpc&lt;BR /&gt;&lt;STRONG&gt;mpiicpc -v&lt;/STRONG&gt;&lt;BR /&gt;mpiicpc for the Intel(R) MPI Library 2021.4 for Linux*&lt;BR /&gt;Copyright Intel Corporation.&lt;BR /&gt;icpc version 2021.4.0 (gcc version 9.3.0 compatibility)&lt;BR /&gt;&lt;STRONG&gt;mpiicpc -show&lt;/STRONG&gt;&lt;BR /&gt;icpc -I"/opt/intel/oneapi/mpi/latest/include" -L"/opt/intel/oneapi/mpi/latest/lib/release" -L"/opt/intel/oneapi/mpi/latest/lib" -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker "/opt/intel/oneapi/mpi/latest/lib/release" -Xlinker -rpath -Xlinker "/opt/intel/oneapi/mpi/latest/lib" -lmpicxx -lmpifort -lmpi -ldl -lrt -lpthread&lt;/LI&gt;
&lt;LI&gt;This is a laptop with Core i7-10850H 6 cores 12 processors. I installed Intel OneAPI following&amp;nbsp;&lt;A href="https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/apt.html#apt" target="_blank"&gt;APT (intel.com)&lt;/A&gt;. I didn't do a special configuration. I don't know how to check the hardware and FI_PROVIDER&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;My production environment (a HPC) has a different intel compiler but works fine&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;intel-ps-2018u4,&amp;nbsp;icpc (ICC) 18.0.5 20180823,&amp;nbsp;gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 07 Oct 2021 16:06:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1320054#M8815</guid>
      <dc:creator>Mach</dc:creator>
      <dc:date>2021-10-07T16:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent file content between runs with MPI_File_write</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1321947#M8826</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for providing the details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are able to get the correct results as shown in the below screenshot with standalone ubuntu 20.04 machine using intel oneAPI 2021.4.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshY_Intel_0-1634202396327.png" style="width: 993px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/19966i9781714DBB3497F1/image-dimensions/993x231?v=v2&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" width="993" height="231" role="button" title="SantoshY_Intel_0-1634202396327.png" alt="SantoshY_Intel_0-1634202396327.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;I&gt;&amp;gt;&amp;gt;"My production environment (a HPC) has a different intel compiler but works fine"&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Could you please try and let us know whether you are facing the same issue in your HPC environment?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Santosh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 09:08:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1321947#M8826</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2021-10-14T09:08:42Z</dc:date>
    </item>
    <item>
      <title>Re:Inconsistent file content between runs with MPI_File_write</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1323732#M8859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We haven't heard back from you. Could you please try and let us know whether you are facing the same issue in your HPC environment?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;santosh&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2021 10:56:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1323732#M8859</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2021-10-21T10:56:22Z</dc:date>
    </item>
    <item>
      <title>Re:Inconsistent file content between runs with MPI_File_write</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1325442#M8875</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As we have not heard back from you, we are closing this thread and will no longer be monitored by Intel. If you need further assistance, please post a new question.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Oct 2021 09:17:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/Inconsistent-file-content-between-runs-with-MPI-File-write/m-p/1325442#M8875</guid>
      <dc:creator>SantoshY_Intel</dc:creator>
      <dc:date>2021-10-28T09:17:06Z</dc:date>
    </item>
  </channel>
</rss>

