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