Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
| hpc:numericserveruser:hpc_numericserver:batch_job_scripts:good_practice [2019/11/20 00:37] – kraus | hpc: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. '' | ||
| + | |||
| + | === Example header for a batch job script: === | ||
| + | |||
| + | < | ||
| + | #!/bin/bash --login | ||
| + | #$ -N [jobname] | ||
| + | # job resources | ||
| + | #$ -l mem_free=[xxxM]|[yyyG] | ||
| + | #$ -l h_rt=HH: | ||
| + | #$ -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, | ||
| + | #$ -M [name_of_your_mailbox] | ||
| + | </ | ||
| + | (where < | ||
| + | \\ | ||
| + | |||
| + | === Detailed description of the batch job directives: === | ||
| + | |||
| + | < | ||
| + | #!/bin/bash --login | ||
| + | </ | ||
| + | < | ||
| + | ## invoke an appropriate **login** shell | ||
| + | </ | ||
| + | \\ | ||
| + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\ | ||
| + | \\ | ||
| + | < | ||
| + | #$ -N [jobname] | ||
| + | </ | ||
| + | < | ||
| + | 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) | ||
| + | </ | ||
| + | \\ | ||
| + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\ | ||
| + | \\ | ||
| + | < | ||
| + | The next directives ask for host resources your job needs, please choose carefully | ||
| + | </ | ||
| + | < | ||
| + | #$ -l mem_free=[xxxM]|[yyyG] | ||
| + | </ | ||
| + | < | ||
| + | sum of resident/ | ||
| + | </ | ||
| + | < | ||
| + | #$ -l h_rt=[HH: | ||
| + | </ | ||
| + | < | ||
| + | hard runtime/ | ||
| + | </ | ||
| + | \\ | ||
| + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\ | ||
| + | \\ | ||
| + | < | ||
| + | #$ -q [name_of_job_queue] | ||
| + | </ | ||
| + | < | ||
| + | (special) queue the job is to be scheduled (**parameter generally not needed**) | ||
| + | </ | ||
| + | < | ||
| + | #$ -pe [name_of_parallel_env] [no_of_cpu_cores] | ||
| + | </ | ||
| + | < | ||
| + | (special) parallel environment and number of cores for your job | ||
| + | </ | ||
| + | \\ | ||
| + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\ | ||
| + | \\ | ||
| + | < | ||
| + | #$ -cwd | ||
| + | </ | ||
| + | < | ||
| + | change to (current) directory, where your input files reside | ||
| + | </ | ||
| + | \\ | ||
| + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\ | ||
| + | \\ | ||
| + | < | ||
| + | #$ -o stdout.out | ||
| + | </ | ||
| + | < | ||
| + | file where stdout of shell is redirected | ||
| + | </ | ||
| + | < | ||
| + | #$ -e stderr.out | ||
| + | </ | ||
| + | < | ||
| + | file where stderr of shell is redirected | ||
| + | </ | ||
| + | < | ||
| + | < | ||
| + | stderr and stdout should (yes) or shouldn' | ||
| + | </ | ||
| + | \\ | ||
| + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\\ | ||
| + | \\ | ||
| + | < | ||
| + | #$ -m [n|b|e|e, | ||
| + | </ | ||
| + | < | ||
| + | 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 | ||
| + | </ | ||
| + | < | ||
| + | #$ -M [name_of_your_mailbox] | ||
| + | </ | ||
| + | < | ||
| + | only needed when mails should be send | ||
| + | </ | ||
| + | \\ | ||
| + | <WRAP rightalign> | ||
| + | date of revision: 02-14-2020 © kraus | ||
| + | </ | ||