hpc:numericserveruser:hpc_numericserver:batch_job_scripts:good_practice

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
hpc:numericserveruser:hpc_numericserver:batch_job_scripts:good_practice [2019/11/20 00:37] – kraushpc:numericserveruser:hpc_numericserver:batch_job_scripts:good_practice [2020/02/14 18:05] (aktuell) – kraus
Zeile 1: Zeile 1:
 +===== Good Practice - Available parameters =====
  
 +**(please also cf. ''man qsub'')**
 +
 +=== Example header for a batch job script: ===
 +
 +<code>
 +#!/bin/bash --login
 +#$ -N [jobname]
 +# job resources
 +#$ -l mem_free=[xxxM]|[yyyG]
 +#$ -l h_rt=HH:MM:SS
 +#$ -q [name_of_job_queue]
 +#$ -pe [name_of_parallel_env] [no_of_cpu_cores]
 +# cd to execution path
 +#$ -cwd
 +# mail stuff
 +#$ -o stdout.out
 +#$ -e stderr.out
 +#$ -j [no|yes]
 +#$ -m [n|b|e|e,b,...]  
 +#$ -M [name_of_your_mailbox]
 +</code>
 +(where <nowiki>"|"</nowiki> signifies **exclusive OR** and all lines beginning with **#$** are directives interpreted the batch job scheduler)\\ 
 +\\
 +
 +=== Detailed description of the batch job directives: ===
 +
 +<code>
 +#!/bin/bash --login
 +</code>
 +<file>
 +## invoke an appropriate **login** shell 
 +</file>
 +\\
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\
 +\\
 +<code>
 +#$ -N [jobname]
 +</code>
 +<file>
 +freely choose your own job name 
 +(gotcha: string is not(!) allowed to start with a numerical character and special characters like  #, @, ? and *  are not(!) permitted)
 +</file>
 +\\
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\
 +\\
 +<file>
 +The next directives ask for host resources your job needs, please choose carefully
 +</file>
 +<code>
 +#$ -l mem_free=[xxxM]|[yyyG]
 +</code>
 +<file>
 +sum of resident/physical memory in Mebibytes or Gibibytes used by all processes within your job
 +</file>
 +<code>
 +#$ -l h_rt=[HH:MM:SS]
 +</code>
 +<file>
 +hard runtime/wall clock time limit of your job in **HOURS:MINS:SECS**
 +</file>
 +\\
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\
 +\\
 +<code>
 +#$ -q [name_of_job_queue]
 +</code>
 +<file>
 +(special) queue the job is to be scheduled (**parameter generally not needed**)
 +</file>
 +<code>
 +#$ -pe [name_of_parallel_env] [no_of_cpu_cores]    (possible parallel environments are mp (runs on a single node) and ompi (multiple nodes)
 +</code>
 +<file>
 +(special) parallel environment and number of cores for your job
 +</file>
 +\\
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\
 +\\
 +<code>
 +#$ -cwd
 +</code>
 +<file>
 +change to (current) directory, where your input files reside
 +</file>
 +\\
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\
 +\\
 +<code>
 +#$ -o stdout.out
 +</code>
 +<file>
 +file where stdout of shell is redirected
 +</file>
 +<code>
 +#$ -e stderr.out
 +</code>
 +<file>
 +file where stderr of shell is redirected
 +</file>
 +<code> #$ -j [no|yes] </code>
 +<file>
 +stderr and stdout should (yes) or shouldn't (no) be redirected to same file/merged
 +</file>
 +\\
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\
 +\\
 +<code>
 +#$ -m [n|b|e|e,b,...] 
 +</code>
 +<file>
 +mails about job status changes (n, no mail; b, beginning; e, end; ...) are send to the address given in [name_of_mailbox] 
 +or no mails (n) are send
 +</file>
 +<code>
 +#$ -M [name_of_your_mailbox]
 +</code>
 +<file>
 +only needed when mails should be send
 +</file>
 +\\
 +<WRAP rightalign>
 +date of revision: 02-14-2020 © kraus
 +</WRAP>