<?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 nested mpirun commands in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/nested-mpirun-commands/m-p/1025624#M4095</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;I have an mpi program that calls another mpi program (written by someone else) using a fortran system call&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;driver.f90&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;call MPI_INIT(..)&lt;/P&gt;

&lt;P&gt;system('mpirun -np 2 ./mpi_prog.x')&lt;/P&gt;

&lt;P&gt;call MPI_FINALIZE(...)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When I run it (e.g. mpirun -np 4 ./driver.x) it crashes inside mpi_prog.x (at a barrier). When I build it using mpich it works fine though. Any hints on what might be wrong (I realize nested mpirun's are completely beyond the mpi standard and highly dependent on implementation)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;NOTE: when I do something like:&lt;/P&gt;

&lt;P&gt;mpirun -hosts hostA,hostB -perhost 1 -np 2 mpirun -np 4 hostname&lt;/P&gt;

&lt;P&gt;it works perfectly fine and returns the correct output.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jun 2015 22:07:47 GMT</pubDate>
    <dc:creator>okkebas</dc:creator>
    <dc:date>2015-06-03T22:07:47Z</dc:date>
    <item>
      <title>nested mpirun commands</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/nested-mpirun-commands/m-p/1025624#M4095</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;I have an mpi program that calls another mpi program (written by someone else) using a fortran system call&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;driver.f90&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;call MPI_INIT(..)&lt;/P&gt;

&lt;P&gt;system('mpirun -np 2 ./mpi_prog.x')&lt;/P&gt;

&lt;P&gt;call MPI_FINALIZE(...)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When I run it (e.g. mpirun -np 4 ./driver.x) it crashes inside mpi_prog.x (at a barrier). When I build it using mpich it works fine though. Any hints on what might be wrong (I realize nested mpirun's are completely beyond the mpi standard and highly dependent on implementation)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;NOTE: when I do something like:&lt;/P&gt;

&lt;P&gt;mpirun -hosts hostA,hostB -perhost 1 -np 2 mpirun -np 4 hostname&lt;/P&gt;

&lt;P&gt;it works perfectly fine and returns the correct output.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2015 22:07:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/nested-mpirun-commands/m-p/1025624#M4095</guid>
      <dc:creator>okkebas</dc:creator>
      <dc:date>2015-06-03T22:07:47Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/nested-mpirun-commands/m-p/1025625#M4096</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;good that you realize that this violates the MPI standard in so many ways.&lt;/P&gt;

&lt;P&gt;Luckily, there is a solution in MPI-2 and it's called MPI_COMM_SPAWN:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;integer ierr,intercomm
integer errcodes(2)

call MPI_COMM_SPAWN("./mpi_prog.x","",2,MPI_INFO_NULL,0,MPI_COMM_WORLD,intercomm,errcodes,ierr)
if (.not.all(errcodes.eq.MPI_SUCCESS)) then
  print*,'Error!'
  call MPI_Abort(MPI_COMM_WORLD,1,ierr)
endif&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Quite some magic happens in the MPI_Init routine, so I expect your NOTE seems to work fine because you're not running an actual MPI-program.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 06:40:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/nested-mpirun-commands/m-p/1025625#M4096</guid>
      <dc:creator>John_D_6</dc:creator>
      <dc:date>2015-06-04T06:40:00Z</dc:date>
    </item>
  </channel>
</rss>

