<?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 Dear Jim, in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147336#M7786</link>
    <description>&lt;P&gt;Dear Jim,&lt;/P&gt;

&lt;P&gt;it is written in Fortran&lt;/P&gt;

&lt;P&gt;best regards&lt;/P&gt;

&lt;P&gt;Timo&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 11:17:39 GMT</pubDate>
    <dc:creator>Timo_W_</dc:creator>
    <dc:date>2017-10-27T11:17:39Z</dc:date>
    <item>
      <title>split output by mpi rank</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147334#M7784</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I was wondering if there is a possiblity to redirect and split stdout of each mpi rank to a seperate file, so that I can investigate the output of each mpi rank seperately.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;best regards,&lt;/P&gt;

&lt;P&gt;Timo&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>Thu, 26 Oct 2017 06:45:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147334#M7784</guid>
      <dc:creator>Timo_W_</dc:creator>
      <dc:date>2017-10-26T06:45:47Z</dc:date>
    </item>
    <item>
      <title>Is your program written in C</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147335#M7785</link>
      <description>&lt;P&gt;Is your program written in C/C++ or Fortran. Both can replace stdout with a file (i.e file with rank number embedded).&lt;/P&gt;

&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/18086193/redirect-stdout-stderr-to-file-under-unix-c-again"&gt;https://stackoverflow.com/questions/18086193/redirect-stdout-stderr-to-file-under-unix-c-again&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 17:17:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147335#M7785</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2017-10-26T17:17:00Z</dc:date>
    </item>
    <item>
      <title>Dear Jim,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147336#M7786</link>
      <description>&lt;P&gt;Dear Jim,&lt;/P&gt;

&lt;P&gt;it is written in Fortran&lt;/P&gt;

&lt;P&gt;best regards&lt;/P&gt;

&lt;P&gt;Timo&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 11:17:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147336#M7786</guid>
      <dc:creator>Timo_W_</dc:creator>
      <dc:date>2017-10-27T11:17:39Z</dc:date>
    </item>
    <item>
      <title>Fortran has interoperablee</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147337#M7787</link>
      <description>&lt;P&gt;Fortran has interoperablee function calls. You can call C from Fortran, and link in an object file generated by C/C++. This is relatively easy to do to get what you want.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 16:52:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147337#M7787</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2017-10-27T16:52:42Z</dc:date>
    </item>
    <item>
      <title>I don't know if it is</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147338#M7788</link>
      <description>&lt;P&gt;I don't know if it is possible to do this directly with a command of the form: "mpirun mpi_binary.exe", but it should be easy enough to do if you add a "wrapper" script in the middle.&lt;/P&gt;

&lt;P&gt;Most of my MPI jobs are launched with commands of the form: "mpirun wrapper.sh mpi_binary.exe".&lt;/P&gt;

&lt;P&gt;In this case, mpirun launches one instance of "wrapper.sh" for each MPI rank.&amp;nbsp; In the wrapper.sh script, I set up output file names based on the hostname and MPI rank number, then execute the "mpi_binary.exe" with rank-specific IO redirection.&lt;/P&gt;

&lt;P&gt;A simple example might be (untested):&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;#!/bin/bash

MYHOST=`hostname -s`
MYRANK=$PMI_RANK           # this variable may depend on your execution environment

PERFOUT=perf.$MYHOST.$MYRANK
STD_OUT=stdout.$MYHOST.$MYRANK
STD_ERR=stderr.$MYHOST.$MYRANK

# assume that the arguments to this script are the name of the executable
# followed by any of its required options

perf stat -o $PERFOUT $* 2&amp;gt; $STD_ERR 1&amp;gt; $STD_OUT&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:21:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147338#M7788</guid>
      <dc:creator>McCalpinJohn</dc:creator>
      <dc:date>2017-10-30T12:21:25Z</dc:date>
    </item>
    <item>
      <title>Dear John,</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147339#M7789</link>
      <description>&lt;P&gt;Dear John,&lt;/P&gt;

&lt;P&gt;this might help me. I will investigate the example and try to adapt it to my case. Thanks!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;best,&lt;/P&gt;

&lt;P&gt;Timo&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 13:15:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/split-output-by-mpi-rank/m-p/1147339#M7789</guid>
      <dc:creator>Timo_W_</dc:creator>
      <dc:date>2017-10-30T13:15:24Z</dc:date>
    </item>
  </channel>
</rss>

