mpi - Determine total CPU count after qsub within PBS script -


for pbs script called qsub, want know how many total cpu's have been allocated in case number defined in pbs file overwritten inputs command line. example following pbs script file:

jobscript.pbs:

#!/bin/bash #pbs -n test_run #pbs -l nodes=32 #pbs -l walltime=06:00:00 #pbs -j oe #pbs -q normal #pbs -o output.txt  cd $pbs_o_workdir  module load gcc-openmpi-1.2.7 time mpiexec visct 

this script run 16 cpu's (instead of 32) using following command line:

$ qsub -l nodes=2:ppn=8 jobscript.pbs 

so robust method determining how many cpu's available within script.

i able answer own question following solution using $pbs_nodefile environment variable contains path file listing information available nodes:

jobscript.pbs:

#!/bin/bash #pbs -n test_run #pbs -l nodes=32 #pbs -l walltime=06:00:00 #pbs -j oe #pbs -q normal #pbs -o output.txt  # finds out number of nodes have np=$(wc -l $pbs_nodefile | awk '{print $1}') echo "total cpu count = $np" 

thanks "source" after online searching.


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -