Helene
Helene

Reputation: 959

Handle multiple nodes in one pbs job

I would like to have 5 nodes running a same job for my 5 samples respectively at once. Instead of writing and submitting 5 pbs files manually, what would be the common way to handle it in one pbs file please?

some updates 05/12/16:
  1. like @dbeer pointed out, pbsdsh seems to be the standard method, and it would be really convenient if jobs are the same with one another. For my particular case, I would need to generate .sh files for each sample and carefully name them, so that I can take advantage of $PBS_VNODENUM. Here are some useful sample codes:

https://wikis.nyu.edu/display/NYUHPC/PBSDSH

http://hpc-uit.readthedocs.io/en/latest/help/faq.html#how-can-i-run-in-parallel-without-using-mpi

http://arc-ts.umich.edu/software/torque/job-arrays/

An existing post about similar issues: PBS/TORQUE: how do I submit a parallel job on multiple nodes?

  1. However, I ended up using python to generate pbs file for each sample, and within same python file qsub them individually in a loop. I don't think it is too much extra work. Just make sure to have system sleep time between each submission. (Here is an example of how to submit pbs in using python)

Upvotes: 0

Views: 2165

Answers (1)

dbeer
dbeer

Reputation: 7203

The really basic way to handle this in Torque (assuming pbs is Torque in this case) if you want to run hostname on each node you could have a script dash.sh:

#!/bin/bash

/usr/local/bin/pbsdsh hostname # change path if you have a non-default installation

Then:

qsub dash.sh -l nodes=5

pbsdsh with no arguments will launch one instance of hostname for each execution slot in the job on the hosts specified in the job's $PBS_NODEFILE. There are different arguments to control its behavior and these can be found in the manpage for pbsdsh.

Upvotes: 1

Related Questions