Pbsjob example.sh: Difference between revisions

From KIP Wiki
ā§¼kip-jumptonavigationā§½ā§¼kip-jumptosearchā§½
No edit summary
Line 1: Line 1:
Download: [[media:Pbsjob_example.sh]]

#! /usr/bin/zsh
#! /usr/bin/zsh
#
#

Revision as of 15:03, 20 February 2009

Download: media:Pbsjob_example.sh

#! /usr/bin/zsh
#
# Example submission script for Torque or PBS (Portable Batch System)
#
# Usage:   submit job with
#             qsub pbsjob_example.sh
#
#===========================================================================
#                      PBS Job Parameters
# All parameters start with #PBS, so that the shell ingores them,
# but the PBS server reads them!
#===========================================================================
#
# Job name (default is the name of pbs script file)
#PBS -N pbsjob_example
#
# Path/filename for standard output. Default: [job_name].o[job_id]
#PBS -o /tmp/pbsjob_example.out
#
# Path/filename for error output. Default: [job_name].e[job_id]
#PBS -e /tmp/pbsjob_example.err
#
# Queue name (e.g. Instant, Short, Medium, Long, Eternal). Default: Medium
#PBS -q Instant@stud.kip.uni-heidelberg.de
#
# Execution host (this option increases job standby time. Better remove it!!!)
#PBS -l host=mare05.atlas-farm.kip.uni-heidelberg.de
#
# Send e-mail at the end or abort:
#PBS -m ae
#
# Do not rerun this job if it fails
#PBS -r n
#
#===========================================================================
#               Unique Directory on the Scratch Disk
#===========================================================================
#
# The unique directory for a job is created automatically
# in: /scratch/pbstmp.${PBS_JOBID} on the execution host.
# The subdirectory is removed after the job finished.
# The total amount of data in this directory must not exceed 20 GB!
#
cd /scratch/pbstmp.${PBS_JOBID}
#
#===========================================================================
#               Run the job
#===========================================================================
#
# The output of the following commands will be appear in the job output file.
#
# get system name
#
uname -a
echo " "
echo "====================================================================="
echo " "
#
# test basic shell environment variables
#
echo "HOSTNAME   = " $HOSTNAME
echo "PBS_O_HOST = " $PBS_O_HOST
echo " "
echo "PATH = " $PATH
echo "PBS_O_PATH = " $PBS_O_PATH
echo " "
echo "LOGNAME       = " $LOGNAME
echo "PBS_O_LOGNAME = " $PBS_O_LOGNAME
echo " "
echo "HOME       = " $HOME
echo "PBS_O_HOME = " $PBS_O_HOME
echo " "
echo "SHELL       = " $SHELL
echo "PBS_O_SHELL = " $PBS_O_SHELL
echo " "
echo "MAIL       = " $MAIL
echo "PBS_O_MAIL = " $PBS_O_MAIL
echo " "
echo "PWD           = " $PWD
echo "PBS_O_WORKDIR = " $PBS_O_WORKDIR
echo " "
echo "PBS_O_QUEUE = " $PBS_O_QUEUE
echo "PBS_QUEUE   = " $PBS_QUEUE
echo " "
echo "PBS_JOBID   = " $PBS_JOBID
echo "PBS_JOBNAME = " $PBS_JOBNAME
echo "PBS_NNODES  = " $PBS_NNODES
echo "PBS_ENVIRONMENT = " $PBS_ENVIRONMENT
#
# now print all shell environment variable
#
echo " "
echo "====================================================================="
echo " "
env
#
# test allowed system resources
#
echo " "
echo "====================================================================="
echo " "
ulimit -a
#
# create some file aaa and copy it to my data directory
#
echo " "
echo "====================================================================="
echo " "
echo "Hello World" > aaa
cp -pv aaa /data/stud/x01/users/${LOGNAME}/
ls -al /data/stud/x01/users/${LOGNAME}/
#
# run ATLAS Athena Hello World program
#
echo " "
echo "====================================================================="
echo " "
source /atlas/athena/11.2.0/setup.sh
source /atlas/athena/11.2.0/dist/11.2.0/Control/AthenaRunTime/AthenaRunTime-00-00-06/cmt/setup.sh
athena.py AthExHelloWorld/HelloWorldOptions.py 2>&1
#