[Rocks-Discuss] mpich/intel's mpirun isn't passing command line arguments

David Shrader dshrader at wisc.edu
Mon Feb 18 11:08:27 PST 2008


Thank you, Jason, for giving me that simple program to work with.  It 
has helped me to figure out what is going on.

I've discovered that the issue isn't that mpirun isn't passing command 
line arguments, it's that mpirun is passing "extra" command line 
arguments.  I modified my failing code to print out all the args passed 
to it before quitting:

[dshrader at compute-0-2 testing]$ mpirun -np 2 -machinefile $PBS_NODEFILE 
./a.out 20000
argc = 6
argv[0] = /home/dshrader/testing/./a.out
argv[1] = 20000
argv[2] = -p4pg
argv[3] = /home/dshrader/testing/PI11296
argv[4] = -p4wd
argv[5] = /home/dshrader/testing
argv[6] = (null)
Usage: /home/dshrader/testing/./a.out  <number of elements>

This particular bit of code is very restrictive in that it will bail if 
the number of command line arguments isn't exactly two.

I've looked through the documentation again in /opt/mpich/intel/ and in 
the man pages, but didn't find any mention of these extra command 
arguments.  Why are these arguments being passed when other mpirun's 
(such as an intel one from an older version of the intel-developer roll 
that we are using on our other cluster) don't pass them?

Obviously, I could change this code so as not to bail, but I don't think 
that is fixing the real issue (although the number of programs actually 
affected by this is probably quite small).  Is there a way to turn these 
extra arguments off so that code doesn't have to modified just because 
of the mpirun used to execute the job?

Thanks again for the help!
David

jason bishop wrote the following on 02/16/2008 05:36 PM:
> david, your right, this is a simple thing.  i don't have a suggestion, 
> but i have a datapoint for you to compare against for /opt/mpich/intel 
> using following version of our intel-developer roll:
> 
> first, intel-developer version:
> md5sum intel-developer-4.3-10.1.011.x86_64.disk1.iso
> f637eac2c4f3d267c8503af01831ff42  
> intel-developer-4.3-10.1.011.x86_64.disk1.iso
> 
> these are the steps i performed (note slightly modified hello_c.c):
> 
> [jason at dell1425e1 ~]$ which mpirun
> /opt/mpich/intel/bin/mpirun
> [jason at dell1425e1 ~]$ cat hello_c.c
> /*
>  * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
>  *                         University Research and Technology
>  *                         Corporation.  All rights reserved.
>  * Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.
>  *
>  * Sample MPI "hello world" application in C
>  */
> 
> #include <stdio.h>
> #include "mpi.h"
> 
> int main(int argc, char* argv[])
> {
>     int rank, size;
> 
>     MPI_Init(&argc, &argv);
>     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
>     MPI_Comm_size(MPI_COMM_WORLD, &size);
>     printf("Hello, world, I am %d of %d, argv[1]='%s'\n", rank, size, 
> argv[1]);
>     MPI_Finalize();
> 
>     return 0;
> }
> [jason at dell1425e1 ~]$ mpicc hello_c.c
> [jason at dell1425e1 ~]$ mpirun -np 2 -machinefile host ./a.out "these are 
> args man"
> Hello, world, I am 0 of 2, argv[1]='these are args man'
> Hello, world, I am 1 of 2, argv[1]='these are args man'
> 
> jason
> 
> On Feb 16, 2008, at 1:13 PM, David Shrader wrote:
> 
>> Hello all,
>>
>> I'm trying to run some parallel code on a newly installed cluster, and
>> am having trouble running jobs that have worked on another cluster we
>> have.  The problem seems to be that the mpirun we're using doesn't 
>> pass command line arguments to the executable.  I'm using ROCKS 4.3, and
>> /opt/mpich/intel/ from the intel-developer roll.  Here's a simple 
>> example that I compiled the source code using mpicc in the same 
>> directory just named.  I tried both submission scripts and 
>> interactively logging in:
>>
>> [dshrader at korczak ~]$ qsub -I -q all -lnodes=1:ppn=4
>> qsub: waiting for job 8.korczak.msae.wisc.edu to start
>> qsub: job 8.korczak.msae.wisc.edu ready
>>
>> [dshrader at compute-0-2 ~]$ cd testing/
>> [dshrader at compute-0-2 testing]$ mpirun -np 4 -machinefile 
>> $PBS_NODEFILE ./spmd_sum_3 20000
>> Usage: /home/dshrader/testing/./spmd_sum_3  <number of elements>
>> [dshrader at compute-0-2 testing]$ mpirun -np 4 -machinefile 
>> $PBS_NODEFILE ./spmd_sum_3
>> Usage: /home/dshrader/testing/./spmd_sum_3  <number of elements>
>>
>> This program is designed to throw that usage message if the needed
>> command line parameter isn't passed to it.  Like I said before, this
>> little bit of code works on our other cluster running Rocks 4.3, both 
>> from interactive logon and submission script.  I have tried other 
>> executables, such as parallel hello world, that don't take command 
>> line arguments, and they run with the expected output.
>>
>> This seems like such a simple question, and I am slightly embarrassed
>> that I am not able to come up with a solution on my own.  None of my
>> google searching has helped, nor does mpirun's manpage help, as all it 
>> says is that it should be able to take the command line arguments.  I 
>> am not finding any more documentation than that for the mpi 
>> environment we're using, though.  What have I missed?
>>
>> As always, any and all help is appreciated!  Thank you!
>> David
>> -- 
>> David Shrader
>> Research Assistant
>> Computational Materials Group
>> Materials Science Program
>> University of Wisconsin - Madison
>> email: dshrader at wisc.edu
>> web: http://matmodel.engr.wisc.edu/
>>
> 
> 

-- 
David Shrader
Research Assistant
Computational Materials Group
Materials Science Program
University of Wisconsin - Madison
email: dshrader at wisc.edu
web: http://matmodel.engr.wisc.edu/


More information about the npaci-rocks-discussion mailing list