<br><font size=2 face="sans-serif">The Blue Gene mpirun has a -label option
that does exactly what you want. &nbsp;Setting the env var MPIRUN_LABEL=1
(or to any value probably) should also do it. &nbsp; See the App Development
redbook. &nbsp;There is a chapter on mpirun that lists all the options
and env vars. &nbsp;The options/vars should also work with mpiexec (which
is really the same cmd).</font>
<br><font size=2 face="sans-serif"><br>
-todd<br>
<br>
-----<br>
Todd Inglett<br>
Blue Gene Product Software Architecture<br>
(507) 253-3617 &nbsp;tinglett@us.ibm.com<br>
</font>
<br>
<br><tt><font size=2>discuss-bounces@lists.alcf.anl.gov wrote on 04/12/2010
10:21:01 PM:<br>
<br>
&gt; [image removed] </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Re: [alcf-discuss] Labeling stdout, stderr with rank?</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Peter Messmer </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; to:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; discuss</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; 04/12/2010 10:21 PM</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Sent by:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; discuss-bounces@lists.alcf.anl.gov</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Please respond to ALCF BG/P discussion list</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Hi Tim,<br>
&gt; <br>
&gt; Did you try setting the MPIEXEC_PREFIX_DEFAULT (or MPIEXEC_PREFIX_STDOUT
<br>
&gt; or MPI_PREFIX_STDERR) environment variables?<br>
&gt; <br>
&gt; Peter<br>
&gt; <br>
&gt; <br>
&gt; On 4/12/2010 8:41 PM, Anthony Chan wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hi Jeff,<br>
&gt; &gt;<br>
&gt; &gt; There are occasions that it is difficult to modify the source
code<br>
&gt; &gt; to print out the rankID. &nbsp;A typical example is error/assertion<br>
&gt; &gt; message from system libraries like MPI or math library. &nbsp;It<br>
&gt; &gt; is useful for the cqsub/mpirun to prefix rank ID to show where<br>
&gt; &gt; offending message comes from.<br>
&gt; &gt;<br>
&gt; &gt; A.Chan<br>
&gt; &gt;<br>
&gt; &gt; ----- &quot;Jeff Hammond&quot;&lt;jhammond@mcs.anl.gov&gt; &nbsp;wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; I'm sorry I cannot answer the question directly, but is it
not<br>
&gt; &gt;&gt; reasonable to label fprintf statements directly?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; printf(&quot;hello world\n&quot;);<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; becomes<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; printf(&quot;%d: hello world\n&quot;,DCMF_Messager_rank());<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I imagine you can do this with the preprocessor or a remapping
of<br>
&gt; &gt;&gt; printf itself, although the latter may involve some fun-and-games<br>
&gt; &gt;&gt; with<br>
&gt; &gt;&gt; symbol redefinition at link time.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Best,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Jeff<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Mon, Apr 12, 2010 at 6:01 PM, Tim Tautges&lt;tautges@mcs.anl.gov&gt;<br>
&gt; &gt;&gt; wrote:<br>
&gt; &gt;&gt;&gt; Hi all,<br>
&gt; &gt;&gt;&gt; &nbsp; Is there any way to label the .output, .error
files with the rank<br>
&gt; &gt;&gt; they came<br>
&gt; &gt;&gt;&gt; from, producing a separate file for each proc? &nbsp;I've
searched around<br>
&gt; &gt;&gt; in the<br>
&gt; &gt;&gt;&gt; FAQ and elsewhere, but can't find anything. &nbsp;I recall
seeing<br>
&gt; &gt;&gt; somewhere that<br>
&gt; &gt;&gt;&gt; you can use the qsub -O option, and some special character
like %<br>
&gt; &gt;&gt; that gets<br>
&gt; &gt;&gt;&gt; replaced by the rank. &nbsp;I've tried %, but that doesn't
work.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Also, I'm using --env MPIRUN_LABEL=1 on my qsub command,
but it's<br>
&gt; &gt;&gt; not<br>
&gt; &gt;&gt;&gt; labeling output by rank like it's supposed to be. &nbsp;Has
anyone else<br>
&gt; &gt;&gt; seen<br>
&gt; &gt;&gt;&gt; this?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Thanks.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; - tim<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; --<br>
&gt; &gt;&gt;&gt; ================================================================<br>
&gt; &gt;&gt;&gt; &quot;You will keep in perfect peace him whose mind is<br>
&gt; &gt;&gt;&gt; &nbsp; steadfast, because he trusts in you.&quot; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Isaiah 26:3<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Tim Tautges
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Argonne National Laboratory<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(tautges@mcs.anl.gov)
&nbsp; &nbsp; &nbsp;(telecommuting from UW-Madison)<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;phone: (608) 263-8485
&nbsp; &nbsp; &nbsp;1500 Engineering Dr.<br>
&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fax: (608) 263-4499
&nbsp; &nbsp; &nbsp;Madison, WI 53706<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; _______________________________________________<br>
&gt; &gt;&gt;&gt; discuss mailing list<br>
&gt; &gt;&gt;&gt; discuss@lists.alcf.anl.gov<br>
&gt; &gt;&gt;&gt; </font></tt><a href=https://lists.alcf.anl.gov/mailman/listinfo/discuss><tt><font size=2>https://lists.alcf.anl.gov/mailman/listinfo/discuss</font></tt></a><tt><font size=2><br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; Jeff Hammond<br>
&gt; &gt;&gt; Argonne Leadership Computing Facility<br>
&gt; &gt;&gt; jhammond@mcs.anl.gov / (630) 252-5381<br>
&gt; &gt;&gt; </font></tt><a href=http://www.linkedin.com/in/jeffhammond><tt><font size=2>http://www.linkedin.com/in/jeffhammond</font></tt></a><tt><font size=2><br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; discuss mailing list<br>
&gt; &gt;&gt; discuss@lists.alcf.anl.gov<br>
&gt; &gt;&gt; </font></tt><a href=https://lists.alcf.anl.gov/mailman/listinfo/discuss><tt><font size=2>https://lists.alcf.anl.gov/mailman/listinfo/discuss</font></tt></a><tt><font size=2><br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; discuss mailing list<br>
&gt; &gt; discuss@lists.alcf.anl.gov<br>
&gt; &gt; </font></tt><a href=https://lists.alcf.anl.gov/mailman/listinfo/discuss><tt><font size=2>https://lists.alcf.anl.gov/mailman/listinfo/discuss</font></tt></a><tt><font size=2><br>
&gt; _______________________________________________<br>
&gt; discuss mailing list<br>
&gt; discuss@lists.alcf.anl.gov<br>
&gt; </font></tt><a href=https://lists.alcf.anl.gov/mailman/listinfo/discuss><tt><font size=2>https://lists.alcf.anl.gov/mailman/listinfo/discuss</font></tt></a><tt><font size=2><br>
</font></tt>