#!/bin/csh # # file: script.example # # purpose: template for PBS (Portable Batch System) script # # remarks: lines commented with MUST must be specified; # a line beginning with # is a comment; # a line beginning with #PBS is a pbs command; # assume (upper/lower) case to be sensitive; # # use: submit job with # qsub script.txt # # WRNING !: There are collected parameters which can be used # for job submission to the PBS. Not all are needed for # typical jobs (ie: for jobs which are properly # running under NQS). # The parameters which are not necessary to job submission # are depicted with star symbol (*). # # Note: This script was used for real production for CMS experiment # #--------------------------------------------------------------------- # job name (default is name of pbs script file) #PBS -N test1.job # # path/filename for standard output # Please specify different names for different jobs or # remove this option!!! #PBS -o test1.out # # path/filename for standard error # Please specify different names for different jobs or # remove this option!!! #PBS -e test1.err # # queue name, one of {xxl, long, medium, short} in minutes (will be updated) # The default queue, "long", need not be specified #PBS -l cput=00:20:00 # # send me mail when job begins #PBS -m b # # send mail to adres : #PBS -M somebody@itep.ru # # send me mail when job end #PBS -m e # send me mail when job aborts (with an error) #PBS -m a # # collect all mail's options together: #PBS -m abe # # do not rerun this job if it fails (*) #PBS -r n # # Using PBS - Environment Variables # When a batch job starts execution, a number of environment variables are # predefined, which include: # # Variables defined on the execution host. # Variables exported from the submission host with # -v (selected variables) and -V (all variables). # Variables defined by PBS. # # The following reflect the environment where the user ran qsub: # PBS_O_HOST The host where you ran the qsub command. # PBS_O_LOGNAME Your user ID where you ran qsub. # PBS_O_HOME Your home directory where you ran qsub. # PBS_O_WORKDIR The working directory where you ran qsub. # PBS_O_QUEUE The original queue you submitted to. # PBS_QUEUE The queue the job is executing from. # PBS_JOBID The job's PBS identifier. # PBS_JOBNAME The job's name. ### # # the rest of script should be here # #============================================================== # Startup procedure #============================================================== # # UNIQUE DIRECTORY ON THE SCRATCH DISK # ! prefered solution ! # # The unique directory for a job is created by this script: # /scr/rrc00*/username/src2 on the executable host, # where * is a number of node (from 0 to 3), username - your username. # This directory /scr/rrc00*/username/src2 is removed by this script # after job completion. # # echo "" echo Starting batch on `hostname` echo "" # Setting job environment (this is for CMS but you can put here # your own settings)... cmsim cms117 # Changing WORKDIR name to have the network taransparant access # automounter will not mount anything beginning from /net setenv PBS_O_WORKDIR `echo $PBS_O_WORKDIR|sed s/net/scr/` # Now we find the directory name from which the job was started # to put it on local /scratch. The name must be unique!!! setenv WRKDIR `basename $PBS_O_WORKDIR` # Removing the directory with that name on /scratch (if exists) to # avoid possible software conflicts if ( -d ${SCRATCH}/${WRKDIR} ) then rm -fr ${SCRATCH}/${WRKDIR} endif # Coping the starting directory to /scratch cp -r $PBS_O_WORKDIR ${SCRATCH}/${WRKDIR} # Now we are going to scratch... cd ${SCRATCH}/${WRKDIR} # Coping some bulk data from other locations (use scp if they are # outside ITEP or even outside cluster) cp /scr/triton_/kolosov/jets-ring/hlljj-3.5.ntpl hlljj.ntpl # Making the binaries and moving their to current directoty (if it is # needed). Of cause, you can use already prepared executables here. ./cmsbuild mv ${SCRATCH}/cms117.exe . # ...and runing them ./cms117b.run echo "" echo Finishing batch on `hostname` echo You can find the results in /scr/`hostname`/`whoami`/${WRKDIR} echo ""