[MPICH] RE: [gt-user] Run a wrapped command with MPI

Brian R. Toonen toonen at mcs.anl.gov
Tue May 15 15:08:37 CDT 2007


Some implementations of mpirun pass command line arguments to the executable
which are then used during MPI_Init() to determine how many processes to
start, etc.  Your script isn't passing those command line arguments to the
cpi executable.

Try the following script.  It's a bit ugly, but it should work.

#!/bin/sh

IFS=
args=""
while test $# -gt 0 ; do
    args="$args '"`echo "$1" | sed -e "s/'/'"'"'"'"'"'"'/g"`"'"
    shift
done
args=`echo "$args" | sed 's/^ *//'`

eval ./cpi "$args"

--brian

|-----Original Message-----
|From: owner-gt-user at globus.org [mailto:owner-gt-user at globus.org] On Behalf
|Of Matias Alberto Gavinowich
|Sent: Monday, May 14, 2007 14:43
|To: mpich-discuss at mcs.anl.gov; torqueusers at supercluster.org; gt-
|user at globus.org
|Subject: [gt-user] Run a wrapped command with MPI
|
|Hello:
|
|I am having the following problem.
|
|I can run a comand through mpi invoking:
|
|mpirun -np 2 ./cpi   (I am using my machines.LINUX default file).
|
|Two processes are started, as expected.
|
|Then, I write a wrapper script that looks like:
|
|#!/bin/sh
|./cpi             (I also tried with a full path)
|
|and I run:
|
|mpirun -np 2 ./cpiwrapper
|
|Only one process is started in this case.
|
|The trick is I need it to work with a wrapper, because jobmanager-pbs
|from globus invokes it this way (with a wrapper script).
|
|AFAIK, I am running MPICH1.
|
|Has anyone come accross this?
|
|Thank you,
|
|Matt




More information about the mpich-discuss mailing list