[GE users] LAM & SGE

Alexandre Barras Alexandre.Barras at cerfacs.fr
Wed Jul 7 11:21:28 BST 2004


Hello,

I did not find on Internet any way to configure LAM within SGE without changing the LAM boot schema and qrsh-lam.

So I wrote my own scripts and I suggest you my solution that is in fact very similar to the MPI integration provided with SGE
Thanks to them, you can submit LAM job to SGE with the command: qsub -pe lam myscript

For those interested:


Add the PE:
        % qconf -sp lam 
        pe_name lam
        slots 999
        user_lists NONE
        xuser_lists NONE
        start_proc_args /gridware/sge/mpi/startlam.sh
        stop_proc_args /gridware/sge/mpi/stoplam.sh
        allocation_rule $round_robin
        control_slaves TRUE
        job_is_first_task FALSE
        
        

startlam.sh
------------------------------------------------------------
#!/bin/sh
#
#
# preparation of the mpi/lam machine file
#
# usage: startlam.sh <pe_hostfile>
#

PeHostfile2MachineFile()
{
   cat $1 | while read line; do
 	     # echo $line
 	     host=`echo $line|cut -f1 -d" "|cut -f1 -d"."`
 	     nslots=`echo $line|cut -f2 -d" "`
 	     echo $host cpu=$nslots
   done
}

me=`basename $0`

# test number of args
if [ $# -ne 1 ]; then
   echo "$me: got wrong number of arguments" >&2
   exit 1
fi

# get arguments
pe_hostfile=$1

# ensure pe_hostfile is readable
if [ ! -r $pe_hostfile ]; then
   echo "$me: can't read $pe_hostfile" >&2
   exit 1
fi

# create machine-file
# remove column with number of slots per queue
# mpi does not support them in this form
machines="$TMPDIR/machines"
PeHostfile2MachineFile $pe_hostfile >> $machines


#
# Make script wrapper for 'rsh' available in jobs tmp dir
#
rsh_wrapper=$SGE_ROOT/mpi/rsh
if [ ! -x $rsh_wrapper ]; then
      echo "$me: can't execute $rsh_wrapper" >&2
      echo "     maybe it resides at a file system not available at this machine" >&2
      exit 1
fi

rshcmd=rsh
case "$ARC" in
      hp|hp10|hp11|hp11-64) rshcmd=remsh ;;
      *) ;;
esac
# note: This could also be done using rcp, ftp or s.th.
#       else. We use a symbolic link since it is the
#       cheapest in case of a shared filesystem
#
ln -s $rsh_wrapper $TMPDIR/$rshcmd


# signal success to caller
exit 0




stoplam.sh
------------------------------------------------------------
#!/bin/sh
#       
rm $TMPDIR/machines

rshcmd=rsh
case "$ARC" in
   hp|hp10|hp11|hp11-64) rshcmd=remsh ;;
   *) ;;
esac
rm $TMPDIR/$rshcmd




LAM script Template
------------------------------------------------------------
#!/bin/csh 
#
# pe request
#$ -pe lam 15
#

cat $TMPDIR/machines 
echo " "

# change this line to fit your needs
setenv PATH /usr/local/lam7.0/bin:$PATH 
lamboot -v $TMPDIR/machines

# work to do 
cd /home/barras/BENCHMARK_LAM/AVBP/RUN/RUN3
mpirun C $AVBP_HOME/HOST/PENTIUM4/AVBPEXEC/AVBP_V5.2.PENTIUM4
lamhalt -v


             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	     Alexandre Barras - Computing Support Group
        CERFACS, 42 Av. Coriolis, F-31057 TOULOUSE Cedex 1, FRANCE
        Tel.: (+33) [0]5 61 19 30 75   Fax: (+33) [0]5 61 19 30 00

             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list