<?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:Cannot read namelist when using MPI with OneAPI in Windows 10 in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459764#M165302</link>
    <description>&lt;P&gt;I tested the workaround with multiple ranks, it does work as expected.  I also have another workaround.  Add a newline to the end of your test.nml file.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;To be clear, this is definitely not a Fortran issue.  This is a matter of how Windows is handling redirects for standard input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When you run mpiexec, it first parses through the arguments.  In this parsing, it identifies key options for mpiexec and the application (plus arguments) you have specified.  It uses the mpiexec options to define how to launch the application, and launches the application (along with any arguments).  Normally, standard input is redirected to your application.  If you need to type anything in, it will be passed to the application at that time.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In the Windows command prompt, redirecting standard input from a file with "&amp;lt; file" tells Windows that you want standard input to come from this file.  This will only allow the specified file to act as standard input.  That file will be the equivalent of you typing in the contents of the file.  In this case, the last thing in your file is the "/" ending the namelist, but not a newline (equivalent to pressing enter) to complete that line of input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The reason this works outside of the MPI environment is that when redirecting standard input, mpiexec is receiving the specified input and has to pass it through to the application.  In this passthrough, the implicit end of input from the end of file does not make it through, causing your application to hang.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The reason the batch file method works is that it embeds the redirect to be directly to the application, rather than to mpiexec.  If you create a batch file with "echo %*", it will show you all of the arguments passed.  Run that batch file with a redirect, and you'll notice that the redirect is not an argument.  Windows parses it before the batch file is started, and the batch file never sees it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It is possible that this could be fixed in mpiexec.  However, since adding a newline at the end of your input file is a sufficient workaround, and this is likely a fairly complicated fix, I do not expect it will be addressed.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please confirm that this workaround is functional for you.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 27 Feb 2023 14:40:06 GMT</pubDate>
    <dc:creator>James_T_Intel</dc:creator>
    <dc:date>2023-02-27T14:40:06Z</dc:date>
    <item>
      <title>Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1458029#M165205</link>
      <description>&lt;P&gt;I just wanted rank 0 cpu core read from the input namelist, and output the content of this namelist on the screen. However it seems Intel OneAPI on windows just cannot make it work. Is it some bug or something?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The minimal working example is extremely simple as below,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;program test
use mympi
implicit none
integer :: irn
real :: hbar
namelist /mylist/ irn, hbar
call init0 ! mpi initialization
if (myrank() .eq. 0) then ! only rank 0 cpu core do the read and write.
read(5, nml=mylist)
write(6, nml=mylist)
write(6,*) 'irn = ', irn
write(6,*) 'hbar = ', hbar
endif
call done
end program&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I place the test.exe file and the test.nml file in one folder. &lt;BR /&gt;If I run the program like below,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;mpiexec -n 6 test.exe &amp;lt; test.nml&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the program just hangs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, if I just do,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;test.exe &amp;lt; test.nml&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then it works and the correct output is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;amp;MYLIST
IRN = 88888888,
HBAR = 20.73500
/
irn = 88888888
hbar = 20.73500&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know why? &lt;BR /&gt;Thanks much in advance!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;----------------------------&lt;BR /&gt;PS.&lt;/P&gt;
&lt;P&gt;The namelist file test.nml is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;amp;mylist
irn = 88888888 ! random number seed
hbar = 20.735 ! h bar
/&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The mpi module is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;module mympi
use mpi
implicit none
integer, private, parameter :: i4=selected_int_kind(9)
integer, private, parameter :: i8=selected_int_kind(15)
integer, private, parameter :: r8=selected_real_kind(15,9)
integer, private, save :: mpii4,mpii8,mpir8
integer(kind=i4), private, save :: irank,iproc
contains
subroutine init0 ! call this before anything else
integer :: ierror,isize,ir,ip
integer(kind=i4) :: itest4
integer(kind=i8) :: itest8
real(kind=r8) :: rtest8
call mpi_init(ierror)
call mpi_comm_rank(mpi_comm_world,ir,ierror)
irank=ir
call mpi_comm_size(mpi_comm_world,ip,ierror)
iproc=ip
call mpi_sizeof(itest4,isize,ierror)
call mpi_type_match_size(mpi_typeclass_integer,isize,mpii4,ierror)
call mpi_sizeof(itest8,isize,ierror)
call mpi_type_match_size(mpi_typeclass_integer,isize,mpii8,ierror)
call mpi_sizeof(rtest8,isize,ierror)
call mpi_type_match_size(mpi_typeclass_real,isize,mpir8,ierror)
return
end subroutine init0
subroutine done ! wrapper for finalize routine
integer :: ierror
call mpi_finalize(ierror)
return
end subroutine done

function myrank() ! which process am I?
integer(kind=i4) :: myrank
myrank=irank
return
end function myrank

end module mympi&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;For convenience, I uploaded all the VS solution file and all the f90 files and the test.nml file in the attachment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another relavant link is below, similar problem. With MPI the read just does not work correct. &lt;BR /&gt;&lt;A href="https://fortran-lang.discourse.group/t/intel-fortran-cannot-read-from-a-long-line-properly/2933/3" target="_blank" rel="noopener"&gt;https://fortran-lang.discourse.group/t/intel-fortran-cannot-read-from-a-long-line-properly/2933/3&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I posted here too,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://fortran-lang.discourse.group/t/cannot-read-namelist-when-using-mpi-intel-oneapi-windows-10/5248" target="_blank" rel="noopener"&gt;https://fortran-lang.discourse.group/t/cannot-read-namelist-when-using-mpi-intel-oneapi-windows-10/5248&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 22:05:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1458029#M165205</guid>
      <dc:creator>CRquantum</dc:creator>
      <dc:date>2023-02-21T22:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1458791#M165259</link>
      <description>&lt;P&gt;What version of MPI and Fortran are you using?&lt;/P&gt;
&lt;P&gt;I just tried your reproducer on Linux with ifort 2021.8.0 and Intel(R) MPI Library 2021.8 for Linux* . It ran just fine with 6 ranks.&lt;/P&gt;
&lt;P&gt;A workaround for Windows would be "mpiexec -n 1 runme.bat"&amp;nbsp;with "test.exe &amp;lt; test.nml" in runme.bat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 21:14:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1458791#M165259</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-02-23T21:14:02Z</dc:date>
    </item>
    <item>
      <title>Re:Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1458801#M165260</link>
      <description>&lt;P&gt;I'm on our MPI support team and investigating this.  The workaround Barbara mentioned should help you get started.  The issue appears to be between MPI and Windows, with the input redirection not happening correctly.  If I can find another workaround, I will let you know.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Feb 2023 21:38:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1458801#M165260</guid>
      <dc:creator>James_T_Intel</dc:creator>
      <dc:date>2023-02-23T21:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459171#M165273</link>
      <description>&lt;P&gt;Thank you Barbara. Yes the Linux version of Intel OneAPI or the previous parallel studio have no problem.&lt;/P&gt;
&lt;P&gt;This issue only happen on Windows. I am using the most current version of OneAPI as of now, 2023.0 I think. But it seems all the OneAPI has this issue on Windows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the workaround,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/44501"&gt;@Barbara_P_Intel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;What version of MPI and Fortran are you using?&lt;/P&gt;
&lt;P&gt;I just tried your reproducer on Linux with ifort 2021.8.0 and Intel(R) MPI Library 2021.8 for Linux* . It ran just fine with 6 ranks.&lt;/P&gt;
&lt;P&gt;A workaround for Windows would be "mpiexec -n 1 runme.bat"&amp;nbsp;with "test.exe &amp;lt; test.nml" in runme.bat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thank you again Barbara. Yeah the mpiexec -n 1 works. But this seems is same as just do&lt;/P&gt;
&lt;P&gt;`test.exe &amp;lt; test.nml` in the command line without even type `mpiexec -n 1` in front of it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about for more than one core? Like&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"mpiexec -n 4 runme.bat"&amp;nbsp;with "test.exe &amp;lt; test.nml" in runme.bat.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this case it seems each of the 4 cores inpendently run the&amp;nbsp;runme.bat. This is probably not exactly what I want.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Eventually what I want is, you know, many cores are involved, and only rank 0 core readin the test.nml file first, then it broadcast the variables in test.nml to all the other cores.&amp;nbsp; So probably we still need things like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mpiexec -n 6 test.exe &amp;lt; test.nml&lt;/P&gt;
&lt;P&gt;I guess.&lt;/P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 20:54:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459171#M165273</guid>
      <dc:creator>CRquantum</dc:creator>
      <dc:date>2023-02-24T20:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459185#M165275</link>
      <description>&lt;P&gt;Thank you James.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yeah, it is for MPI and windows only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact it is not just for read in the namelist, I have another post actually about the same issue (again on Linux Intel OneAPI is fine),&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://fortran-lang.discourse.group/t/intel-fortran-cannot-read-from-a-long-line-properly/2933/3" target="_blank"&gt;Intel Fortran cannot read from a long line properly? - Fortran Discourse (fortran-lang.discourse.group)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is if the read in file, say file.dat, has long comments, such as&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;9002785287  # * irn. boss random number seed
12          # imode. 11 mean V fixed. 12 means full mixing, both V and k are flexable. CHoose 12 for now.
1000        # * itermax. max iteration number. Usually with stopping criterion code should stop before itermax.
.true.      # * stop_criterion_on. Enabling stop criterion or not. .true. means yes enable.	
30          # * LL_n. The number of continuous iterations for averaged slope. and then calculating the averaged parameters. currently just use this one number. 
0.0         # * crit_1. The value of slope for stop criterion. The iteration begin 'smoothing' stage after averaged slope smaller than this value. Set to zero.
1           # * kmix. The gaussian mixing number.
.true.      # read Yji or generate Yji. Currently set it as .true. 
1000        # * mgauss_all. number of gaussian samples in E step.
5000000     # * m_all. Metropolos samples in M step.
30          # * i_init. This is for initial condition. Currently it is from 1 to 50 which is the number of subjects. Select the subject from simpar to start initial condition	
simdata.csv     # data.csv name
simpar.csv      # parcsvname&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my code is just let rank 0 read in the variables values in the file and print the result as below,&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;program main
use mympi
integer, parameter :: i4=selected_int_kind(9)
integer, parameter :: i8=selected_int_kind(15)
integer, parameter :: r8=selected_real_kind(15,9)
integer(kind=i8) :: irn,imode,itermax,kmix,mgauss_all,m_all,i_init
integer :: LL_n
logical :: stop_criterion_on,readYji
real(kind=r8) :: crit_1
character(len=50) :: csvname != 'simdata.csv' 
character(len=50) :: parcsvname ! = 'simpar.csv'
call init0 !mpi initialization must be done before reading    
  if (myrank()==0) then
    read (5,*) irn
    read (5,*) imode
    read (5,*) itermax
    read (5,*) stop_criterion_on
    read (5,*) LL_n
    read (5,*) crit_1
    read (5,*) kmix
    read (5,*) readYji 
    read (5,*) mgauss_all
    read (5,*) m_all
    read (5,*) i_init
		read (5,'(a50)') csvname
    read (5,'(a50)') parcsvname
    
    csvname = adjustl(csvname)
    csvname = csvname(1:index(csvname,' ')-1) ! there should be space before # in the input file.
    parcsvname = adjustl(parcsvname) 
    parcsvname = parcsvname(1:index(parcsvname,' ')-1) 
    
    write (6,'(''Boss random number seed ='',t30,i20)') irn
    write (6,'(''imode ='',t30,i20)') imode
    write (6,'(''iteration max # ='',t30,i20)') itermax
    write (6,'(''Stop Criterion (SC) on ='',t40,l10)') stop_criterion_on
    write (6,'(''SC # of averaged iterations ='',t30,i20)') LL_n
    write (6,'(''SC stopping slope &amp;lt;'',t40,f10.5)') crit_1
    write (6,'(''Mixing number ='',t30,i20)') kmix
    write (6,'(''Read Yji ='',t40,l10)') readYji
    write (6,'(''# Gauss samples for E step ='',t30,i20)') mgauss_all
    write (6,'(''# Metropolis samples for M step ='',t30,i20)') m_all
    write (6,'(''Initially from subject # '',t30,i20)') i_init
    write (6,'(''data.csv file name ='',t30,a30)') csvname
    write (6,'(''simpar.csv file name ='',t30,a30)') parcsvname  
endif  
end&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with MPI, again If I do&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mpiexec -n 6 test.exe &amp;lt; file.dat&lt;/P&gt;
&lt;P&gt;It hangs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barbara's workaround is great for one core, but I am not very sure if it works for more than one core as I mentioned in the reply post above.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another workaround, is just in the code, we specify&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;open&lt;/SPAN&gt;(action&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'read'&lt;/SPAN&gt;,&amp;nbsp;file&lt;SPAN&gt;='file.dat'&lt;/SPAN&gt;)
&lt;/PRE&gt;
&lt;P&gt;Then just do&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mpiexec -n 6 test.exe&lt;/P&gt;
&lt;P&gt;Then rank 0 can open the file.dat and do read correctly it seems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I am glad Intel noticed this is an issue on Windows. I wish it could be solved in the next release.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much indeed!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 20:53:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459185#M165275</guid>
      <dc:creator>CRquantum</dc:creator>
      <dc:date>2023-02-24T20:53:05Z</dc:date>
    </item>
    <item>
      <title>Re:Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459764#M165302</link>
      <description>&lt;P&gt;I tested the workaround with multiple ranks, it does work as expected.  I also have another workaround.  Add a newline to the end of your test.nml file.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;To be clear, this is definitely not a Fortran issue.  This is a matter of how Windows is handling redirects for standard input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;When you run mpiexec, it first parses through the arguments.  In this parsing, it identifies key options for mpiexec and the application (plus arguments) you have specified.  It uses the mpiexec options to define how to launch the application, and launches the application (along with any arguments).  Normally, standard input is redirected to your application.  If you need to type anything in, it will be passed to the application at that time.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In the Windows command prompt, redirecting standard input from a file with "&amp;lt; file" tells Windows that you want standard input to come from this file.  This will only allow the specified file to act as standard input.  That file will be the equivalent of you typing in the contents of the file.  In this case, the last thing in your file is the "/" ending the namelist, but not a newline (equivalent to pressing enter) to complete that line of input.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The reason this works outside of the MPI environment is that when redirecting standard input, mpiexec is receiving the specified input and has to pass it through to the application.  In this passthrough, the implicit end of input from the end of file does not make it through, causing your application to hang.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The reason the batch file method works is that it embeds the redirect to be directly to the application, rather than to mpiexec.  If you create a batch file with "echo %*", it will show you all of the arguments passed.  Run that batch file with a redirect, and you'll notice that the redirect is not an argument.  Windows parses it before the batch file is started, and the batch file never sees it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It is possible that this could be fixed in mpiexec.  However, since adding a newline at the end of your input file is a sufficient workaround, and this is likely a fairly complicated fix, I do not expect it will be addressed.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please confirm that this workaround is functional for you.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Feb 2023 14:40:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1459764#M165302</guid>
      <dc:creator>James_T_Intel</dc:creator>
      <dc:date>2023-02-27T14:40:06Z</dc:date>
    </item>
    <item>
      <title>Re:Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1460222#M165315</link>
      <description>&lt;P&gt;Since we have multiple workarounds and this is unlikely to receive a fix, I am closing this for Intel support.  Any further replies will be considered community only.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Feb 2023 16:49:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1460222#M165315</guid>
      <dc:creator>James_T_Intel</dc:creator>
      <dc:date>2023-02-28T16:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Cannot read namelist when using MPI with OneAPI in Windows 10</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1460503#M165326</link>
      <description>&lt;P&gt;Thank you James.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yeah I confirm the "newline" trick works.&lt;/P&gt;
&lt;P&gt;Actually thank you for reminding me the this "newline" trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I actually figured out this "newline" trick before, now with your explanation I know why this newline trick works. Again thank you so much.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, thing is, even if you do this "newline" trick, sometimes it still does not work. You can see my reply in this post on&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date" title="Posted on"&gt;&lt;SPAN class="DateTime"&gt;&lt;SPAN class="local-date"&gt;02-24-2023&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt;12:53 PM.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date" title="Posted on"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date" title="Posted on"&gt;&lt;SPAN class="DateTime"&gt;&lt;SPAN class="local-time"&gt;I post it here below for Intel to review, again, it only occurs on Windows,&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date" title="Posted on"&gt;&lt;SPAN class="DateTime"&gt;&lt;SPAN class="local-time"&gt;&lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-OneAPI-cannot-read-from-a-long-line-properly/m-p/1460502#M165325" target="_blank" rel="noopener"&gt;Intel OneAPI cannot read from a long line properly? - Intel Communities&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date" title="Posted on"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-message-post-date lia-component-post-date lia-component-message-view-widget-post-date" title="Posted on"&gt;&lt;SPAN class="DateTime"&gt;&lt;SPAN class="local-time"&gt;But yeah, in this namelist example, both Barbara and James's solutions work, thanks again!&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 06:24:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Cannot-read-namelist-when-using-MPI-with-OneAPI-in-Windows-10/m-p/1460503#M165326</guid>
      <dc:creator>CRquantum</dc:creator>
      <dc:date>2023-03-01T06:24:46Z</dc:date>
    </item>
  </channel>
</rss>

