#!/bin/ksh # # default argument settings (Assuming LAPI build) # nodes=4 network=csss,not_shared,us adaptor=hps_user arg="-euilib us" root=_PATH_/../.. here=`pwd` chemsh=$root exe=$chemsh/bin/chemsh.x.poe dir=/scratch/$USER account=z001 time=0:20:0 # use="[ -n procs ] [-q|c class ] [-a account] [-t time] [-e executable] [-d directory] job " # # process command line options # while getopts :q:c:p:P:a:e:d:t: opt ; do case $opt in q) class=$OPTARG;; c) class=$OPTARG;; p) nodes=$OPTARG;; P) port=$OPTARG;; a) acc=$OPTARG;; t) time=$OPTARG;; e) exe=$OPTARG;; d) dir=$OPTARG;; ?) echo usage: $0 $use;; esac done # # remaining arg should be the job name # let nshift=OPTIND-1 shift $nshift if test $# -ne 1 ; then echo usage: $0 $use exit fi jobname=$1 inputfile=$1 # # If the user has .chm, .chem or .chemsh as extension, strip them # off # trailer=`echo $jobname | awk -F. '{print $NF}'` if test $trailer = chem; then jobname=`echo $jobname | sed 's/\.chem//' ` elif test $trailer = chemsh; then jobname=`echo $jobname | sed 's/\.chemsh//' ` elif test $trailer = chm; then jobname=`echo $jobname | sed 's/\.chm//' ` fi smp=1 # # produce loadleveller script # # # These might need more careful calculation # case $smp in 1) if test $nodes -lt 8 then nodes1=1 nodes2=$nodes else nodes1=`expr 1 + \( $nodes - 1 \) / 8` nodes2=8 if test `expr $nodes1 * $nodes2 ` -ne $nodes then echo node count rounded up to `expr $nodes1 * $nodes2 ` fi fi echo '#@ node = ' $nodes1,$nodes1 > ${jobname}.script echo '#@ tasks_per_node = ' $nodes2 >> ${jobname}.script echo '#@ node_usage=not_shared' >> ${jobname}.script echo '#@ environment = MP_CSS_INTERRUPT=yes' >> ${jobname}.script echo 'export MP_EUIDEVICE=css0' >> $jobname.script echo 'export MP_CSS_INTERRUPT=yes' >> $jobname.script echo 'export MP_EUILIB=us' >> $jobname.script echo 'export MP_INFOLEVEL=1' >> $jobname.script echo 'export MP_PULSE=0' >> $jobname.script echo 'export MP_SINGLE_THREAD=yes' >> $jobname.script echo 'export MP_SHARED_MEMORY=yes' >> $jobname.script echo 'export MP_WAIT_MODE=yield' >> $jobname.script echo 'export AIXTHREAD_SCOPE=S' >> $jobname.script echo 'export RT_GRQ=ON' >> $jobname.script ;; 0) echo '#@ min_processors = ' $nodes > ${jobname}.script echo '#@ max_processors = ' $nodes >> ${jobname}.script echo 'export MP_EUIDEVICE=css0' >> $jobname.script echo 'export MP_CSS_INTERRUPT=yes' >> $jobname.script echo 'export MP_EUILIB=us' >> $jobname.script echo 'export MP_INFOLEVEL=1' >> $jobname.script echo 'export MP_PULSE=0' >> $jobname.script echo 'export MP_WAIT_MODE=yield' >> $jobname.script echo '#export MP_SINGLE_THREAD=yes' >> $jobname.script echo '#export MP_SHARED_MEMORY=yes' >> $jobname.script echo '#export AIXTHREAD_SCOPE=S' >> $jobname.script echo '#export RT_GRQ=ON' >> $jobname.script # Choose specially compiled binary (no SMP ESSL) exe=$chemsh/bin/chemsh.x.no_tk.nosmp ;; esac echo '#@ initialdir = '$here >> ${jobname}.script echo '#@ class = ' $class >> ${jobname}.script echo '#@ job_type = parallel' >> ${jobname}.script echo '#@ output = ' $here/${jobname}.out >> ${jobname}.script echo '#@ error = ' $here/${jobname}.err >> ${jobname}.script echo '#@ network.LAPI = ' $network >> ${jobname}.script echo '#@ wall_clock_limit = ' $time >> ${jobname}.script echo '#@ cpu_limit = ' $time >> ${jobname}.script echo '#@ account_no = ' $account >> ${jobname}.script echo '#@ queue' >> ${jobname}.script echo export TCLLIBPATH=$chemsh/tcl >> ${jobname}.script echo /usr/bin/poe $exe $arg $inputfile >> ${jobname}.script # # submit to the queue # # # list settings # echo 'job = ' $jobname echo 'adaptor = ' $adaptor echo 'class = ' $class echo 'nodes = ' $nodes echo 'direc = ' $here echo 'account = ' $account #echo 'scratch = ' $dir echo 'exe = ' $exe $arg llsubmit ${jobname}.script