[torqueusers] NCPUS environment variable?

Chris Samuel csamuel at vpac.org
Tue Jul 12 00:35:10 MDT 2005

On Tue, 12 Jul 2005 10:12 am, Martin Siegert wrote:

> I am wondering whether (how?) the number of processors for a MPI
> job is available in a PBS script in an environment variable (or
> otherwise).
> Example: I have a script
> #!/bin/bash
> #PBS -S /bin/bash
> #PBS -l walltime=0:12:00
> #PBS -l nodes=4:ppn=2
> mpiexec -machinefile $PBS_NODEFILE -np 8 ./mpi_program

If you use Pete Wyckoff's excellent mpiexec replacement from:


then you can just do:

 mpiexec ./mpi_program

and it will determine all it needs to know through the PBS "tm" interface.  It 
also handles killing/dieing MPI programs a lot better than the rsh/ssh using 

It supports a range of interconnect fabrics and defaults (I believe) to 
Myrinet, so you may want to change the default to mpich-p4 (or whatever your 
fabric requries) when you ./configure it if you're not using Myrinet.

 Christopher Samuel - (03)9925 4751 - VPAC Deputy Systems Manager
 Victorian Partnership for Advanced Computing http://www.vpac.org/
 Bldg 91, 110 Victoria Street, Carlton South, VIC 3053, Australia

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20050712/86d300b2/attachment.bin

More information about the torqueusers mailing list