[torqueusers] can a job determine ncpus allocated to it?

Torsten Rohlfing rohlfing at ieee.org
Wed Sep 19 12:28:30 MDT 2007


Hi --

I was wondering: is there a simple way for a job (i.e., the sh script
submitted to torque) to determine how many, if any, CPUs were allocated
to it using the "-l ncpus=#" qsub option? That would be rather helpful
so the script can then start applications with the correct number of
parallel threads.

I am currently submitting using "-l nodes=1:ppn=#", which allows me to
determine the number of allocated CPUs based on the number of entries in
the $PBS_NODEFILE, but that seems a tiny bit clunky.

Thanks!
  Torsten


More information about the torqueusers mailing list