This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
howto:pbsdsh [2023/10/10 12:48] wikiadmin created |
howto:pbsdsh [2026/08/25 21:58] (current) kevin [Example 2: job script] |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Users should use the '' | Users should use the '' | ||
| + | |||
| + | =====Syntax===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | |||
| + | =====With GNU parallel===== | ||
| However, '' | However, '' | ||
| - | Example: | + | ====Example |
| + | |||
| + | Say you have a shell script '' | ||
| + | |||
| + | Then you can use GNU '' | ||
| <code bash> | <code bash> | ||
| - | SCRIPT=$PWD/ | + | parallel -j 24 pbsdsh -n {%} -- bash -l -c '"' |
| - | INPUTS=inputs.txt | + | </ |
| - | # It's fine to have more input lines than you have requested cpus, | + | |
| - | # extra jobs will be executed as cpus become available | + | |
| - | # Here ' | + | Note that this works even if you have more input lines than the available CPUs (24 in one regular compute node), because |
| - | # and '{}' | + | |
| - | # | + | |
| - | # Pbsdsh starts a very minimal shell. `bash -l` loads all of your startup files, so that things like modules work. | + | |
| - | # The `-c` is so that bash separates out the arguments correctly (otherwise they' | + | |
| - | parallel -j ${PBS_NCPUS} pbsdsh -n {%} -- bash -l -c '"' | + | |
| + | |||
| + | GNU parallel will replace the '' | ||
| + | and '' | ||
| + | |||
| + | Pbsdsh starts a very minimal shell, so we evoke '' | ||
| + | |||
| + | The '' | ||
| + | |||
| + | |||
| + | ====Example 2: job script==== | ||
| + | |||
| + | <code bash> | ||
| + | # | ||
| + | #PBS -N p2nodes | ||
| + | #PBS -l select=2: | ||
| + | #PBS -P YOURPROJECT | ||
| + | #PBS -q normal | ||
| + | #PBS -l walltime=0: | ||
| + | |||
| + | CWD=/ | ||
| + | cd $CWD | ||
| + | echo " | ||
| + | nprocs=`cat $PBS_NODEFILE | wc -l` | ||
| + | |||
| + | SCDIR=/ | ||
| + | |||
| + | SCRIPT=$SCDIR/ | ||
| + | INPUTS=inputs.txt | ||
| + | |||
| + | parallel -j ${nprocs} pbsdsh -n {%} -- bash -l -c '"' | ||
| </ | </ | ||
| - | Ref.: [[https:// | + | |
| + | ===Ref.=== | ||
| + | |||
| + | [[https:// | ||