<?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 Intel Fortran with MPI does not treat WRITE(advance='no') in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1569710#M170758</link>
    <description>&lt;P&gt;I have a problem with running the following simple program using MPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test.f:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      IMPLICIT NONE
      INTEGER :: I, IERR
      CALL MPI_INIT(IERR)
      WRITE(*,'(A)', advance='no') 'input i: '
      READ(*,*) I
      WRITE(*,*) 'I =', I
      CALL MPI_FINALIZE(IERR)
      END&lt;/LI-CODE&gt;&lt;P&gt;command line:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mpiifort test.f
mpirun -np 1 ./a.out&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Here, input i: should be displayed first, but nothing appears on the screen. If I enter 1 where nothing is displayed, it shows &lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mpiexec -np 1 ./a.out
1
input i: I = 1&lt;/LI-CODE&gt;&lt;P&gt;Like this, input i: is displayed late.&lt;/P&gt;&lt;P&gt;If I compile with gfortran using mpif90, it works normally.&lt;/P&gt;&lt;P&gt;Also, it works normally if I run it without using mpirun - just launch ./a.out.&lt;/P&gt;&lt;P&gt;if I use the non-standard traditional extension method like below, it also works normally.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WRITE(*,‘(A$)’) 'input i: ’ &lt;/LI-CODE&gt;&lt;P&gt;I think this is a bug of Intel-fortran-compiler, both ifort and ifx gave the same results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OS is ROCKY linux 8 and the compiler version is as follows:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifort -V Intel® Fortran Intel® 64 Compiler Classic for applications running on Intel® 64, Version 2021.9.0 Build 20230302_000000 Copyright © 1985-2023 Intel Corporation. All rights reserved.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tetsuya Mishima&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 10:12:35 GMT</pubDate>
    <dc:creator>tmishima</dc:creator>
    <dc:date>2024-02-06T10:12:35Z</dc:date>
    <item>
      <title>Intel Fortran with MPI does not treat WRITE(advance='no')</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1569710#M170758</link>
      <description>&lt;P&gt;I have a problem with running the following simple program using MPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;test.f:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      IMPLICIT NONE
      INTEGER :: I, IERR
      CALL MPI_INIT(IERR)
      WRITE(*,'(A)', advance='no') 'input i: '
      READ(*,*) I
      WRITE(*,*) 'I =', I
      CALL MPI_FINALIZE(IERR)
      END&lt;/LI-CODE&gt;&lt;P&gt;command line:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mpiifort test.f
mpirun -np 1 ./a.out&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Here, input i: should be displayed first, but nothing appears on the screen. If I enter 1 where nothing is displayed, it shows &lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mpiexec -np 1 ./a.out
1
input i: I = 1&lt;/LI-CODE&gt;&lt;P&gt;Like this, input i: is displayed late.&lt;/P&gt;&lt;P&gt;If I compile with gfortran using mpif90, it works normally.&lt;/P&gt;&lt;P&gt;Also, it works normally if I run it without using mpirun - just launch ./a.out.&lt;/P&gt;&lt;P&gt;if I use the non-standard traditional extension method like below, it also works normally.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WRITE(*,‘(A$)’) 'input i: ’ &lt;/LI-CODE&gt;&lt;P&gt;I think this is a bug of Intel-fortran-compiler, both ifort and ifx gave the same results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OS is ROCKY linux 8 and the compiler version is as follows:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifort -V Intel® Fortran Intel® 64 Compiler Classic for applications running on Intel® 64, Version 2021.9.0 Build 20230302_000000 Copyright © 1985-2023 Intel Corporation. All rights reserved.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tetsuya Mishima&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 10:12:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1569710#M170758</guid>
      <dc:creator>tmishima</dc:creator>
      <dc:date>2024-02-06T10:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Intel Fortran with MPI does not treat WRITE(advance='no')</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1569734#M170759</link>
      <description>&lt;P&gt;I am not convinced that non-advancing i/o to standard output&amp;nbsp; (i.e. not a file) is a thing you can reasonably expect to work. It is rather dependant on what standard output is connected to and its functionality.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 12:06:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1569734#M170759</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2024-02-06T12:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Intel Fortran with MPI does not treat WRITE(advance='no')</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1570780#M170824</link>
      <description>&lt;P&gt;This probably will not run as you would expect under MPI.&amp;nbsp; input/output for programs under MPI pass the IO through MPI's daemons which launch and control the process(es).&amp;nbsp; These daemons buffer output, typically at line boundaries, not character boundaries.&amp;nbsp; So what you are trying to do makes no sense under MPI.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is why most MPI programs are designed to read input from files ( only rank 0 should be reading stdin ) and write output to files.&lt;/P&gt;
&lt;P&gt;You can see the behavior of stdout buffering by writing a simple hello world that prints hello and it's rank number.&amp;nbsp; what you will find with -np great than 1 is that the order of output from the ranks is random BUT each line is intact - characters are not splattered all over the place.&amp;nbsp; This is because the MPI daemons are buffering at the line level, without synchronization, and atomically send each line intact to stdout.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 01:00:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1570780#M170824</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2024-02-09T01:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Intel Fortran with MPI does not treat WRITE(advance='no')</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1570890#M170825</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you for your comments.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The conventional approach using $ has been working as expected for over 10 years. Additionally, I am aware of the bug fix related to non-MPI sequential cases in the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Writing-to-standard-output-with-advance-no/m-p/1145261" target="_self"&gt;https://community.intel.com/t5/Intel-Fortran-Compiler/Writing-to-standard-output-with-advance-no/m-p/1145261&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I potsed here.&lt;/P&gt;&lt;P&gt;If my case aligns with the expected standard behavior of MPI, I will continue using the traditional $ method.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tetsuya Mishima&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 07:28:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-with-MPI-does-not-treat-WRITE-advance-no/m-p/1570890#M170825</guid>
      <dc:creator>tmishima</dc:creator>
      <dc:date>2024-02-09T07:28:42Z</dc:date>
    </item>
  </channel>
</rss>

