#!/bin/bash # # Script Name : ssub # Purpose : PBS serial batch job submission with command line input executables # generated with default compiler. On our system, gcc is the # system default compiler. User may use "module" to choose # the default compiler. ( a companion jsubi is written # specifically for executables created with Intel compiler; # if intel compiler is chosen as default compiler via "module", # jsub and jsubi would be fully equivalent) # The problem with directly submitting a batch job thru PBS qsub # is the fact that qsub does not accept command line input other # than a run script. As a result, unless you always runs the same # executable with same runtime and same number of processors, you # will inevitably have to create many runscripts to cater to # different situations. # This script circumvene that by acting as an interface. Running of # this script, which accepts command line input, such as exec name, # number of processors, etc., and generate a temp script that # include all those command line input into the script and submit # it via qsub. This temp script is called "ssub.USERID", where USERID # is the user's own ID. # Usage: # cootie % ssub exec-name [-l walltime=xx:xx:xx ...] # # Example: # cootie % ssub ../../a.out '-l walltime=00:30:00' # # The output files from using this script are: # 1) ssub.USERID -- the temp script # 2) ssub.USERID.ennnnn -- PBS error file # 3) ssub.USERID.onnnnn -- PBS output file # 4) ssub.USERID.out -- stdout file (output to "terminal") # # Author : Kadin Tseng, SCV, Boston University # Date : April 23, 2005 if [ $# -ge 1 ] then script="ssub.${USER}" MYCODE=$1 echo "#!/bin/bash" > $script echo "cd \$PBS_O_WORKDIR" >> $script echo "$MYCODE > ssub.${USER}.out" >> $script echo "exit 0" >> $script chmod +x $script qsub $script $2 else echo "Usage: ssub a.out ['optional PBS parameters']" fi