This is an old revision of the document!
There is a major problem with using GNU parallel directly on the PBSPro cluster: it uses the ssh transport and not momd which means that the PBS does not know about the tasks. This prevents PBSPro from properly monitoring or cleaning up node(s) when a job ends. Especially if that job ends from error or walltime ending.
Users should use the pbsdsh command to launch multiple serial processes, especially across many nodes.
However, pbsdsh is very simple so it's helpful to use parallel as the task scheduler and pbsdsh to launch the executable on each node.
Example:
SCRIPT=$PWD/script.sh # Script to run. INPUTS=inputs.txt # Each line in this file is used as arguments to ${SCRIPT} # It's fine to have more input lines than you have requested cpus, # extra jobs will be executed as cpus become available # Here '{%}' gets replaced with the job slot ({1..$PBS_NCPUS}) # and '{}' gets replaced with a line from ${INPUTS}. # # 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're all in a single string) parallel -j ${PBS_NCPUS} pbsdsh -n {%} -- bash -l -c '"'${SCRIPT} {}'"' :::: ${INPUTS}
Ref.: GNU parallel at NCI.