<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">1 In the 'bin' directory containing mpif90, the following command shows ifort is used.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial">$./mpif90 -v</span></div>








<p class="">mpifort for MPICH version 3.1.2</p>
<p class="">ifort version 14.0.3</p><p class=""></p><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">2 ifort -mcmodel=medium won't work. </div><p></p><p class=""><span style="font-family:verdana,sans-serif"></span></p><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">Since large array could not work with mpich in my computer, </div>I downloaded openmpi and now it is working fine. The parallel code being modified from the serial<div class="gmail_default" style="font-family:verdana,sans-serif;display:inline"> version</div> is now working.<br><p></p><p class=""></p><div class="gmail_default" style="font-family:verdana,sans-serif;display:inline">Thank you for your attention</div><br><p></p><p class=""><br></p><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 20, 2014 at 8:35 PM,  <span dir="ltr"><<a href="mailto:devel-request@mpich.org" target="_blank">devel-request@mpich.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Send devel mailing list submissions to<br>
        <a href="mailto:devel@mpich.org">devel@mpich.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://lists.mpich.org/mailman/listinfo/devel" target="_blank">https://lists.mpich.org/mailman/listinfo/devel</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:devel-request@mpich.org">devel-request@mpich.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:devel-owner@mpich.org">devel-owner@mpich.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of devel digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re:  <div class="gmail_default" style="font-family:verdana,sans-serif;display:inline"></div>mpich -mcmodel=medium (Junchao Zhang)<br>
   2.  new tutorial books on MPI (Rajeev Thakur)<br>
   3.  proper way to detect if program launched by mpiexec?<br>
      (Jeff Hammond)<br>
   4. Re:  proper way to detect if program launched by mpiexec?<br>
      (Balaji, Pavan)<br>
   5. Re:  proper way to detect if program launched by  mpiexec?<br>
      (Jeff Hammond)<br>
   6. Re:  proper way to detect if program launched by  mpiexec?<br>
      (Rob Latham)<br>
   7. Re:  proper way to detect if program launched     by      mpiexec?<br>
      (Balaji, Pavan)<br>
   8. Re:  proper way to detect if program launched by  mpiexec?<br>
      (Jeff Hammond)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 8 Oct 2014 08:57:34 -0500<br>
From: Junchao Zhang <<a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a>><br>
To: "<<a href="mailto:devel@mpich.org">devel@mpich.org</a>>" <<a href="mailto:devel@mpich.org">devel@mpich.org</a>><br>
Subject: Re: [mpich-devel] mpich -mcmodel=medium<br>
Message-ID:<br>
        <CA+MQGp-=+_<a href="mailto:aK83ef4zdteyckS1nrX8nPQu2XB1yEmeHHWOrEQA@mail.gmail.com">aK83ef4zdteyckS1nrX8nPQu2XB1yEmeHHWOrEQA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Did you build mpich with Intel compilers?<br>
Have you tried to use -mcmodel=large for a non-mpi program and compiled it<br>
with ifort?<br>
<br>
--Junchao Zhang<br>
<br>
On Wed, Oct 8, 2014 at 8:02 AM, WeiGuang He <<a href="mailto:c212heweiguang@gmail.com">c212heweiguang@gmail.com</a>><br>
wrote:<br>
<br>
> Hello, madam/sir<br>
> It seems that "-mcmodel=medium" is not supported by mpif90 (I installed<br>
> the latest mpich).<br>
> How could I use large array?<br>
><br>
> mpif90 mtestf90.f90 winfencef90.f90 -o abc -assume byterecl -shared-intel<br>
> -mcmodel=large -fPIC<br>
><br>
> %% The output is<br>
><br>
> ./abc: symbol lookup error: ./abc: undefined symbol:<br>
> __intel_new_feature_proc_init<br>
><br>
> ./abc: symbol lookup error: ./abc: undefined symbol:<br>
> __intel_new_feature_proc_init<br>
><br>
><br>
><br>
> ===================================================================================<br>
><br>
> =   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES<br>
><br>
> =   PID 27182 RUNNING AT lgmiris<br>
><br>
> =   EXIT CODE: 127<br>
><br>
> =   CLEANING UP REMAINING PROCESSES<br>
><br>
> =   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES<br>
><br>
><br>
> ===================================================================================<br>
><br>
> Best Regards<br>
> Weiguang HE<br>
><br>
> _______________________________________________<br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/devel" target="_blank">https://lists.mpich.org/mailman/listinfo/devel</a><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mpich.org/pipermail/devel/attachments/20141008/aa6e1087/attachment-0001.html" target="_blank">http://lists.mpich.org/pipermail/devel/attachments/20141008/aa6e1087/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 13 Oct 2014 19:06:06 -0500<br>
From: Rajeev Thakur <<a href="mailto:thakur@mcs.anl.gov">thakur@mcs.anl.gov</a>><br>
To: Main MPI Forum mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>>,<br>
        "<<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>>" <<a href="mailto:discuss@mpich.org">discuss@mpich.org</a>>, "<<a href="mailto:devel@mpich.org">devel@mpich.org</a>>"<br>
        <<a href="mailto:devel@mpich.org">devel@mpich.org</a>>, <<a href="mailto:users@open-mpi.org">users@open-mpi.org</a>><br>
Subject: [mpich-devel] new tutorial books on MPI<br>
Message-ID: <<a href="mailto:C7704A78-86D4-4AD8-A759-BEA582AC984B@mcs.anl.gov">C7704A78-86D4-4AD8-A759-BEA582AC984B@mcs.anl.gov</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
Since many of you are interested in MPI, I wanted to bring to your attention two new tutorial books on MPI:<br>
<br>
1. Using MPI: Portable Parallel Programming with the Message-Passing Interface, 3rd edition<br>
   by William Gropp, Ewing Lusk, and Anthony Skjellum<br>
   This is an updated version of their earlier book, and covers basic MPI.<br>
   <a href="http://www.amazon.com/Using-MPI-Programming-Message-Passing-Engineering/dp/0262527391/" target="_blank">http://www.amazon.com/Using-MPI-Programming-Message-Passing-Engineering/dp/0262527391/</a><br>
<br>
2. Using Advanced MPI: Modern Features of the Message-Passing Interface<br>
   by William Gropp, Torsten Hoefler, Rajeev Thakur, and Ewing Lusk<br>
   This is a new book on advanced features of MPI, including the new features in MPI-3.<br>
   <a href="http://www.amazon.com/Using-Advanced-MPI-Message-Passing-Engineering/dp/0262527634/" target="_blank">http://www.amazon.com/Using-Advanced-MPI-Message-Passing-Engineering/dp/0262527634/</a><br>
<br>
Rajeev<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 20 Oct 2014 09:34:09 -0700<br>
From: Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br>
To: MPICH <<a href="mailto:devel@mpich.org">devel@mpich.org</a>><br>
Subject: [mpich-devel] proper way to detect if program launched by<br>
        mpiexec?<br>
Message-ID:<br>
        <CAGKz=<a href="mailto:uLRA7mUPdmgz4yNpmnP_O55-dzQxpqHfhmQTXsMeQR%2BFQ@mail.gmail.com">uLRA7mUPdmgz4yNpmnP_O55-dzQxpqHfhmQTXsMeQR+FQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
I wrote a trivial program that uses MPI_Comm_spawn.  It works when I<br>
launch with mpiexec but not if I run directly.<br>
<br>
1) Is this a bug in MPICH?<br>
2) What is the proper way for the program to detect how the program<br>
was launched?  I would like to provide a helpful warning message...<br>
<br>
Thanks!<br>
<br>
Jeff<br>
<br>
jrhammon-mac01:comm_spawn jrhammon$ ./parent<br>
I am 0 of 1 for the parent program.<br>
[mpiexec@jrhammon-mac01.local] match_arg<br>
(../../../../src/pm/hydra/utils/args/args.c:159): unrecognized<br>
argument pmi_args<br>
[mpiexec@jrhammon-mac01.local] HYDU_parse_array<br>
(../../../../src/pm/hydra/utils/args/args.c:174): argument matching<br>
returned error<br>
[mpiexec@jrhammon-mac01.local] parse_args<br>
(../../../../src/pm/hydra/ui/mpich/utils.c:1596): error parsing input<br>
array<br>
[mpiexec@jrhammon-mac01.local] HYD_uii_mpx_get_parameters<br>
(../../../../src/pm/hydra/ui/mpich/utils.c:1648): unable to parse user<br>
arguments<br>
[mpiexec@jrhammon-mac01.local] main<br>
(../../../../src/pm/hydra/ui/mpich/mpiexec.c:153): error parsing<br>
parameters<br>
^C<br>
<br>
jrhammon-mac01:comm_spawn jrhammon$ mpiexec -n 1 ./parent<br>
I am 0 of 1 for the parent program.<br>
I am 0 of 1 for the child program.<br>
<br>
==> parent.c <==<br>
#include <stdio.h><br>
#include <mpi.h><br>
<br>
int main(int argc, char * argv[])<br>
{<br>
    MPI_Init(&argc,&argv);<br>
<br>
    int size, rank;<br>
    MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
<br>
    printf("I am %d of %d for the parent program.\n", rank, size);<br>
<br>
    MPI_Comm intercomm;<br>
    int errors[size];<br>
    MPI_Comm_spawn( (char*)"./child", MPI_ARGV_NULL, 1, MPI_INFO_NULL,<br>
0 /* root */, MPI_COMM_WORLD, &intercomm, errors);<br>
<br>
    MPI_Finalize();<br>
    return 0;<br>
}<br>
<br>
==> child.c <==<br>
#include <stdio.h><br>
#include <mpi.h><br>
<br>
int main(int argc, char * argv[])<br>
{<br>
    MPI_Init(&argc,&argv);<br>
<br>
    int size, rank;<br>
    MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
<br>
    printf("I am %d of %d for the child program.\n", rank, size);<br>
<br>
    MPI_Finalize();<br>
    return 0;<br>
}<br>
<br>
==> Makefile <==<br>
CC      = mpicc<br>
CFLAGS  = -g -O2 -Wall -std=c99<br>
<br>
LD      = $(CC)<br>
LDFLAGS = $(COPT)<br>
<br>
LIBS =<br>
<br>
TESTS= parent child<br>
<br>
all: $(TESTS)<br>
<br>
%: %.o<br>
        $(CC) $(CFLAGS) $< $(LIBS) -o $@<br>
<br>
clean:<br>
        -rm -f *.o<br>
        -rm -f $(TESTS)<br>
<br>
--<br>
Jeff Hammond<br>
<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
<a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Mon, 20 Oct 2014 16:44:33 +0000<br>
From: "Balaji, Pavan" <<a href="mailto:balaji@anl.gov">balaji@anl.gov</a>><br>
To: "<a href="mailto:devel@mpich.org">devel@mpich.org</a>" <<a href="mailto:devel@mpich.org">devel@mpich.org</a>><br>
Subject: Re: [mpich-devel] proper way to detect if program launched by<br>
        mpiexec?<br>
Message-ID: <<a href="mailto:78272895-503A-4540-8F46-FE165CC34898@anl.gov">78272895-503A-4540-8F46-FE165CC34898@anl.gov</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
<br>
This is a known issue with MPICH.  There?s no portable way to detect this, but for MPICH you can look for PMI variables in the environment.<br>
<br>
  ? Pavan<br>
<br>
> On Oct 20, 2014, at 11:34 AM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<br>
><br>
> I wrote a trivial program that uses MPI_Comm_spawn.  It works when I<br>
> launch with mpiexec but not if I run directly.<br>
><br>
> 1) Is this a bug in MPICH?<br>
> 2) What is the proper way for the program to detect how the program<br>
> was launched?  I would like to provide a helpful warning message...<br>
><br>
> Thanks!<br>
><br>
> Jeff<br>
><br>
> jrhammon-mac01:comm_spawn jrhammon$ ./parent<br>
> I am 0 of 1 for the parent program.<br>
> [mpiexec@jrhammon-mac01.local] match_arg<br>
> (../../../../src/pm/hydra/utils/args/args.c:159): unrecognized<br>
> argument pmi_args<br>
> [mpiexec@jrhammon-mac01.local] HYDU_parse_array<br>
> (../../../../src/pm/hydra/utils/args/args.c:174): argument matching<br>
> returned error<br>
> [mpiexec@jrhammon-mac01.local] parse_args<br>
> (../../../../src/pm/hydra/ui/mpich/utils.c:1596): error parsing input<br>
> array<br>
> [mpiexec@jrhammon-mac01.local] HYD_uii_mpx_get_parameters<br>
> (../../../../src/pm/hydra/ui/mpich/utils.c:1648): unable to parse user<br>
> arguments<br>
> [mpiexec@jrhammon-mac01.local] main<br>
> (../../../../src/pm/hydra/ui/mpich/mpiexec.c:153): error parsing<br>
> parameters<br>
> ^C<br>
><br>
> jrhammon-mac01:comm_spawn jrhammon$ mpiexec -n 1 ./parent<br>
> I am 0 of 1 for the parent program.<br>
> I am 0 of 1 for the child program.<br>
><br>
> ==> parent.c <==<br>
> #include <stdio.h><br>
> #include <mpi.h><br>
><br>
> int main(int argc, char * argv[])<br>
> {<br>
>    MPI_Init(&argc,&argv);<br>
><br>
>    int size, rank;<br>
>    MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
>    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
><br>
>    printf("I am %d of %d for the parent program.\n", rank, size);<br>
><br>
>    MPI_Comm intercomm;<br>
>    int errors[size];<br>
>    MPI_Comm_spawn( (char*)"./child", MPI_ARGV_NULL, 1, MPI_INFO_NULL,<br>
> 0 /* root */, MPI_COMM_WORLD, &intercomm, errors);<br>
><br>
>    MPI_Finalize();<br>
>    return 0;<br>
> }<br>
><br>
> ==> child.c <==<br>
> #include <stdio.h><br>
> #include <mpi.h><br>
><br>
> int main(int argc, char * argv[])<br>
> {<br>
>    MPI_Init(&argc,&argv);<br>
><br>
>    int size, rank;<br>
>    MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
>    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
><br>
>    printf("I am %d of %d for the child program.\n", rank, size);<br>
><br>
>    MPI_Finalize();<br>
>    return 0;<br>
> }<br>
><br>
> ==> Makefile <==<br>
> CC      = mpicc<br>
> CFLAGS  = -g -O2 -Wall -std=c99<br>
><br>
> LD      = $(CC)<br>
> LDFLAGS = $(COPT)<br>
><br>
> LIBS =<br>
><br>
> TESTS= parent child<br>
><br>
> all: $(TESTS)<br>
><br>
> %: %.o<br>
>       $(CC) $(CFLAGS) $< $(LIBS) -o $@<br>
><br>
> clean:<br>
>       -rm -f *.o<br>
>       -rm -f $(TESTS)<br>
><br>
> --<br>
> Jeff Hammond<br>
> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
> <a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
> _______________________________________________<br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/devel" target="_blank">https://lists.mpich.org/mailman/listinfo/devel</a><br>
<br>
--<br>
Pavan Balaji  ??<br>
<a href="http://www.mcs.anl.gov/~balaji" target="_blank">http://www.mcs.anl.gov/~balaji</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Mon, 20 Oct 2014 10:43:16 -0700<br>
From: Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br>
To: <a href="mailto:devel@mpich.org">devel@mpich.org</a><br>
Subject: Re: [mpich-devel] proper way to detect if program launched by<br>
        mpiexec?<br>
Message-ID:<br>
        <CAGKz=uLgNkZy2gD7H=V4ftHYkn=<a href="mailto:VD3ySPSnjQcDDL4-raqpeOA@mail.gmail.com">VD3ySPSnjQcDDL4-raqpeOA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Is this because MPICH can't spawn processes except through<br>
PMI/Hydra/whatever and you - justifiably - do not want to implement a<br>
special case workaround using execvp() directly?<br>
<br>
Jeff<br>
<br>
On Mon, Oct 20, 2014 at 9:44 AM, Balaji, Pavan <<a href="mailto:balaji@anl.gov">balaji@anl.gov</a>> wrote:<br>
><br>
> This is a known issue with MPICH.  There?s no portable way to detect this, but for MPICH you can look for PMI variables in the environment.<br>
><br>
>   ? Pavan<br>
><br>
>> On Oct 20, 2014, at 11:34 AM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<br>
>><br>
>> I wrote a trivial program that uses MPI_Comm_spawn.  It works when I<br>
>> launch with mpiexec but not if I run directly.<br>
>><br>
>> 1) Is this a bug in MPICH?<br>
>> 2) What is the proper way for the program to detect how the program<br>
>> was launched?  I would like to provide a helpful warning message...<br>
>><br>
>> Thanks!<br>
>><br>
>> Jeff<br>
>><br>
>> jrhammon-mac01:comm_spawn jrhammon$ ./parent<br>
>> I am 0 of 1 for the parent program.<br>
>> [mpiexec@jrhammon-mac01.local] match_arg<br>
>> (../../../../src/pm/hydra/utils/args/args.c:159): unrecognized<br>
>> argument pmi_args<br>
>> [mpiexec@jrhammon-mac01.local] HYDU_parse_array<br>
>> (../../../../src/pm/hydra/utils/args/args.c:174): argument matching<br>
>> returned error<br>
>> [mpiexec@jrhammon-mac01.local] parse_args<br>
>> (../../../../src/pm/hydra/ui/mpich/utils.c:1596): error parsing input<br>
>> array<br>
>> [mpiexec@jrhammon-mac01.local] HYD_uii_mpx_get_parameters<br>
>> (../../../../src/pm/hydra/ui/mpich/utils.c:1648): unable to parse user<br>
>> arguments<br>
>> [mpiexec@jrhammon-mac01.local] main<br>
>> (../../../../src/pm/hydra/ui/mpich/mpiexec.c:153): error parsing<br>
>> parameters<br>
>> ^C<br>
>><br>
>> jrhammon-mac01:comm_spawn jrhammon$ mpiexec -n 1 ./parent<br>
>> I am 0 of 1 for the parent program.<br>
>> I am 0 of 1 for the child program.<br>
>><br>
>> ==> parent.c <==<br>
>> #include <stdio.h><br>
>> #include <mpi.h><br>
>><br>
>> int main(int argc, char * argv[])<br>
>> {<br>
>>    MPI_Init(&argc,&argv);<br>
>><br>
>>    int size, rank;<br>
>>    MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
>>    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
>><br>
>>    printf("I am %d of %d for the parent program.\n", rank, size);<br>
>><br>
>>    MPI_Comm intercomm;<br>
>>    int errors[size];<br>
>>    MPI_Comm_spawn( (char*)"./child", MPI_ARGV_NULL, 1, MPI_INFO_NULL,<br>
>> 0 /* root */, MPI_COMM_WORLD, &intercomm, errors);<br>
>><br>
>>    MPI_Finalize();<br>
>>    return 0;<br>
>> }<br>
>><br>
>> ==> child.c <==<br>
>> #include <stdio.h><br>
>> #include <mpi.h><br>
>><br>
>> int main(int argc, char * argv[])<br>
>> {<br>
>>    MPI_Init(&argc,&argv);<br>
>><br>
>>    int size, rank;<br>
>>    MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
>>    MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
>><br>
>>    printf("I am %d of %d for the child program.\n", rank, size);<br>
>><br>
>>    MPI_Finalize();<br>
>>    return 0;<br>
>> }<br>
>><br>
>> ==> Makefile <==<br>
>> CC      = mpicc<br>
>> CFLAGS  = -g -O2 -Wall -std=c99<br>
>><br>
>> LD      = $(CC)<br>
>> LDFLAGS = $(COPT)<br>
>><br>
>> LIBS =<br>
>><br>
>> TESTS= parent child<br>
>><br>
>> all: $(TESTS)<br>
>><br>
>> %: %.o<br>
>>       $(CC) $(CFLAGS) $< $(LIBS) -o $@<br>
>><br>
>> clean:<br>
>>       -rm -f *.o<br>
>>       -rm -f $(TESTS)<br>
>><br>
>> --<br>
>> Jeff Hammond<br>
>> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
>> <a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
>> _______________________________________________<br>
>> To manage subscription options or unsubscribe:<br>
>> <a href="https://lists.mpich.org/mailman/listinfo/devel" target="_blank">https://lists.mpich.org/mailman/listinfo/devel</a><br>
><br>
> --<br>
> Pavan Balaji  ??<br>
> <a href="http://www.mcs.anl.gov/~balaji" target="_blank">http://www.mcs.anl.gov/~balaji</a><br>
><br>
> _______________________________________________<br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/devel" target="_blank">https://lists.mpich.org/mailman/listinfo/devel</a><br>
<br>
<br>
<br>
--<br>
Jeff Hammond<br>
<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
<a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Mon, 20 Oct 2014 12:48:01 -0500<br>
From: Rob Latham <<a href="mailto:robl@mcs.anl.gov">robl@mcs.anl.gov</a>><br>
To: <<a href="mailto:devel@mpich.org">devel@mpich.org</a>><br>
Subject: Re: [mpich-devel] proper way to detect if program launched by<br>
        mpiexec?<br>
Message-ID: <<a href="mailto:54454AD1.9010305@mcs.anl.gov">54454AD1.9010305@mcs.anl.gov</a>><br>
Content-Type: text/plain; charset="windows-1252"; format=flowed<br>
<br>
<br>
<br>
On 10/20/2014 11:34 AM, Jeff Hammond wrote:<br>
> I wrote a trivial program that uses MPI_Comm_spawn.  It works when I<br>
> launch with mpiexec but not if I run directly.<br>
><br>
> 1) Is this a bug in MPICH?<br>
<br>
<a href="http://trac.mpich.org/projects/mpich/ticket/2175" target="_blank">http://trac.mpich.org/projects/mpich/ticket/2175</a><br>
<br>
==rob<br>
<br>
<br>
> 2) What is the proper way for the program to detect how the program<br>
> was launched?  I would like to provide a helpful warning message...<br>
><br>
> Thanks!<br>
><br>
> Jeff<br>
><br>
> jrhammon-mac01:comm_spawn jrhammon$ ./parent<br>
> I am 0 of 1 for the parent program.<br>
> [mpiexec@jrhammon-mac01.local] match_arg<br>
> (../../../../src/pm/hydra/utils/args/args.c:159): unrecognized<br>
> argument pmi_args<br>
> [mpiexec@jrhammon-mac01.local] HYDU_parse_array<br>
> (../../../../src/pm/hydra/utils/args/args.c:174): argument matching<br>
> returned error<br>
> [mpiexec@jrhammon-mac01.local] parse_args<br>
> (../../../../src/pm/hydra/ui/mpich/utils.c:1596): error parsing input<br>
> array<br>
> [mpiexec@jrhammon-mac01.local] HYD_uii_mpx_get_parameters<br>
> (../../../../src/pm/hydra/ui/mpich/utils.c:1648): unable to parse user<br>
> arguments<br>
> [mpiexec@jrhammon-mac01.local] main<br>
> (../../../../src/pm/hydra/ui/mpich/mpiexec.c:153): error parsing<br>
> parameters<br>
> ^C<br>
><br>
> jrhammon-mac01:comm_spawn jrhammon$ mpiexec -n 1 ./parent<br>
> I am 0 of 1 for the parent program.<br>
> I am 0 of 1 for the child program.<br>
><br>
> ==> parent.c <==<br>
> #include <stdio.h><br>
> #include <mpi.h><br>
><br>
> int main(int argc, char * argv[])<br>
> {<br>
>      MPI_Init(&argc,&argv);<br>
><br>
>      int size, rank;<br>
>      MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
>      MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
><br>
>      printf("I am %d of %d for the parent program.\n", rank, size);<br>
><br>
>      MPI_Comm intercomm;<br>
>      int errors[size];<br>
>      MPI_Comm_spawn( (char*)"./child", MPI_ARGV_NULL, 1, MPI_INFO_NULL,<br>
> 0 /* root */, MPI_COMM_WORLD, &intercomm, errors);<br>
><br>
>      MPI_Finalize();<br>
>      return 0;<br>
> }<br>
><br>
> ==> child.c <==<br>
> #include <stdio.h><br>
> #include <mpi.h><br>
><br>
> int main(int argc, char * argv[])<br>
> {<br>
>      MPI_Init(&argc,&argv);<br>
><br>
>      int size, rank;<br>
>      MPI_Comm_size(MPI_COMM_WORLD, &size);<br>
>      MPI_Comm_rank(MPI_COMM_WORLD, &rank);<br>
><br>
>      printf("I am %d of %d for the child program.\n", rank, size);<br>
><br>
>      MPI_Finalize();<br>
>      return 0;<br>
> }<br>
><br>
> ==> Makefile <==<br>
> CC      = mpicc<br>
> CFLAGS  = -g -O2 -Wall -std=c99<br>
><br>
> LD      = $(CC)<br>
> LDFLAGS = $(COPT)<br>
><br>
> LIBS =<br>
><br>
> TESTS= parent child<br>
><br>
> all: $(TESTS)<br>
><br>
> %: %.o<br>
>       $(CC) $(CFLAGS) $< $(LIBS) -o $@<br>
><br>
> clean:<br>
>       -rm -f *.o<br>
>       -rm -f $(TESTS)<br>
><br>
<br>
--<br>
Rob Latham<br>
Mathematics and Computer Science Division<br>
Argonne National Lab, IL USA<br>
<br>
<br>
------------------------------<br>
<br>
Message: 7<br>
Date: Mon, 20 Oct 2014 18:15:21 +0000<br>
From: "Balaji, Pavan" <<a href="mailto:balaji@anl.gov">balaji@anl.gov</a>><br>
To: "<a href="mailto:devel@mpich.org">devel@mpich.org</a>" <<a href="mailto:devel@mpich.org">devel@mpich.org</a>><br>
Subject: Re: [mpich-devel] proper way to detect if program launched     by<br>
        mpiexec?<br>
Message-ID: <<a href="mailto:14724BDF-D159-45C8-A27D-D2BA94C01C73@anl.gov">14724BDF-D159-45C8-A27D-D2BA94C01C73@anl.gov</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
<br>
> On Oct 20, 2014, at 12:43 PM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<br>
> Is this because MPICH can't spawn processes except through<br>
> PMI/Hydra/whatever and you - justifiably - do not want to implement a<br>
> special case workaround using execvp() directly?<br>
<br>
The new process needs a way to query for business cards and such, for which mpiexec is needed.  So the current design of singleton init is to spawn mpiexec and connect to it.  That?s a mess and is not clearly specified by the PMI spec.  My suggestion was to execvp the executable ?mpiexec? with the right arguments to relaunch the application again, but there are some problems with that:<br>
<br>
        <a href="http://trac.mpich.org/projects/mpich/ticket/1074" target="_blank">http://trac.mpich.org/projects/mpich/ticket/1074</a><br>
<br>
  ? Pavan<br>
<br>
--<br>
Pavan Balaji  ??<br>
<a href="http://www.mcs.anl.gov/~balaji" target="_blank">http://www.mcs.anl.gov/~balaji</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 8<br>
Date: Mon, 20 Oct 2014 11:35:19 -0700<br>
From: Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br>
To: <a href="mailto:devel@mpich.org">devel@mpich.org</a><br>
Subject: Re: [mpich-devel] proper way to detect if program launched by<br>
        mpiexec?<br>
Message-ID:<br>
        <CAGKz=<a href="mailto:u%2B7O8A5Zkae6jXqr%2Bu_76ZrJ8owHBASnMhoLHTs56JOmA@mail.gmail.com">u+7O8A5Zkae6jXqr+u_76ZrJ8owHBASnMhoLHTs56JOmA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
On Mon, Oct 20, 2014 at 11:15 AM, Balaji, Pavan <<a href="mailto:balaji@anl.gov">balaji@anl.gov</a>> wrote:<br>
><br>
>> On Oct 20, 2014, at 12:43 PM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<br>
>> Is this because MPICH can't spawn processes except through<br>
>> PMI/Hydra/whatever and you - justifiably - do not want to implement a<br>
>> special case workaround using execvp() directly?<br>
><br>
> The new process needs a way to query for business cards and such, for which mpiexec is needed.  So the current design of singleton init is to spawn mpiexec and connect to it.  That?s a mess and is not clearly specified by the PMI spec.  My suggestion was to execvp the executable ?mpiexec? with the right arguments to relaunch the application again, but there are some problems with that:<br>
<br>
Thanks for the info.  I have no problem accepting the terms of MPI-3,<br>
section 8.7, paragraph 1, and forcing myself to use mpiexec.<br>
<br>
Jeff<br>
<br>
--<br>
Jeff Hammond<br>
<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
<a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@mpich.org">devel@mpich.org</a><br>
<a href="https://lists.mpich.org/mailman/listinfo/devel" target="_blank">https://lists.mpich.org/mailman/listinfo/devel</a><br>
<br>
End of devel Digest, Vol 23, Issue 5<br>
************************************<br>
</blockquote></div><br></div></div>