[mpich-discuss] Parsing mpirun global options in main C

Gonzalo Martín Cruz gmcruz at arcos.inf.uc3m.es
Mon Aug 27 07:54:16 CDT 2012

I'm working in a project in which I need to parse the machinefile provided
in the mpirun call, so I need the name and path provided in the argument
after the "-machinefile" (or "-f") option.

At this time I wouldn't like to wrap the calls to mpirun as Myles
suggested. I would like to be able (if it is possible) to do the parse in
the C code.

Thank you,

Gonzalo Martin

On Mon, Aug 27, 2012 at 2:26 PM, Pavan Balaji <balaji at mcs.anl.gov> wrote:

> Why do you need the remaining arguments?  There are other ways in MPI to
> get this information.
>  -- Pavan
> On 08/27/2012 06:20 AM, Gonzalo Martín Cruz wrote:
>> Hi,
>> I am trying to parse the command line global options for mpirun in the
>> main section of my C program. For example, when I run:
>> mpirun -np 2 -machinefile hostfile ./myprogram 100
>> I would like to parse the seven arguments instead of these two only:
>> "./myprogram" and "100".
>> I tried to parse the arguments before the MPI_Init call but at this
>> point I already got only two arguments, I guess the mpirun executable
>> "eats" the MPI specific arguments. I can't find the way to do that.
>> Thank you in advance,
>> Gonzalo Martin
>> Computer Architecture Group
>> Universidad Carlos III de Madrid
>> e-mail: gmcruz at arcos.inf.uc3m.es <mailto:gmcruz at arcos.inf.uc3m.**es<gmcruz at arcos.inf.uc3m.es>
>> >
>> ______________________________**_________________
>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>> To manage subscription options or unsubscribe:
>> https://lists.mcs.anl.gov/**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss>
> --
> Pavan Balaji
> http://www.mcs.anl.gov/~balaji
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120827/f12d7d45/attachment.html>

More information about the mpich-discuss mailing list