Thanks a lot.<br><br><div class="gmail_quote">On Tue, Dec 4, 2012 at 3:36 AM, Jeff Hammond <span dir="ltr"><<a href="mailto:jhammond@alcf.anl.gov" target="_blank">jhammond@alcf.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As far as I can tell, there's no standard way to access argc/argv from<br>
Fortran until Fortran 2003<br>
(<a href="http://fortranwiki.org/fortran/show/Command-line+arguments" target="_blank">http://fortranwiki.org/fortran/show/Command-line+arguments</a>).  Until<br>
MPI-3, the Fortran bindings were targeting FORTRAN 77 and Fortran 90<br>
and 95 (and somewhat awkwardly), so there was no reasonable way to try<br>
to deal with them.<br>
<br>
Now that there are Fortran 2008 bindings in MPI-3, it might be<br>
interesting to consider how to handle argc/argv in a nice way just as<br>
is done for C.  I don't know if anyone has thought of what happens<br>
when Fortran 2003+ users use the argc/argv access routines.  It would<br>
seem that the same problem would exist that is present if one accesses<br>
argc/argv in C before MPI_INIT is called (i.e. argc/argv will have<br>
mpiexec-related arguments, not just the ones relative to the user<br>
program).<br>
<br>
I created a ticket with the MPI Forum about this:<br>
<a href="https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/351" target="_blank">https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/351</a>.<br>
<br>
Best,<br>
<br>
Jeff<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Dec 3, 2012 at 9:19 AM, Rajeev Thakur <<a href="mailto:thakur@mcs.anl.gov">thakur@mcs.anl.gov</a>> wrote:<br>
> The Fortran binding for MPI_Init is<br>
><br>
> MPI_INIT(IERROR)<br>
><br>
> There are no command line arguments.<br>
><br>
> Rajeev<br>
><br>
><br>
> On Dec 3, 2012, at 6:22 AM, clara wrote:<br>
><br>
>> Hi,<br>
>><br>
>> I added a print statement at the beginning of MPI_Init() in mpich2-1.4 in order to check the arguments of MPI_Init(). When running a Fortran program, e.g. ep.S.1, the arguments of MPI_Init() are NULL; however, when running a C program, e.g. is.S.1, *argc of MPI_Init() is 1 and (*argv)[0] points to the name of the executed file is.S.1.<br>

>> Can anyone tell us why there is difference in dealing with arguments of MPI_Init() between C and Fortran programs? How could arguments be transferred to MPI_Init() for Fortran programs in mpich2? Thanks.<br>
>><br>
>> Best,<br>
>> Clara<br>
>> _______________________________________________<br>
>> discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
>> To manage subscription options or unsubscribe:<br>
>> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
><br>
> _______________________________________________<br>
> discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Jeff Hammond<br>
Argonne Leadership Computing Facility<br>
University of Chicago Computation Institute<br>
<a href="mailto:jhammond@alcf.anl.gov">jhammond@alcf.anl.gov</a> / <a href="tel:%28630%29%20252-5381" value="+16302525381">(630) 252-5381</a><br>
<a href="http://www.linkedin.com/in/jeffhammond" target="_blank">http://www.linkedin.com/in/jeffhammond</a><br>
<a href="https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond" target="_blank">https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
</div></div></blockquote></div><br>