In slurm we can pass an environment variable to a job to get the number of cpus allocated to the job.
Count of CPUs available to the job on the nodes in the allocation, using the format CPU_count [(x number_of_nodes )][, CPU_count [(x number_of_nodes )] …]. For example: SLURM_JOB_CPUS_PER_NODE=‘72(x2),36’ indicates that on the first and second nodes (as listed by SLURM_JOB_NODELIST) the allocation has 72 CPUs, while the third node has 36 CPUs. NOTE : The select/linear plugin allocates entire nodes to jobs, so the value indicates the total count of CPUs on allocated nodes. The select/cons_res and select/cons_tres plugins allocate individual CPUs to jobs, so this number indicates the number of CPUs allocated to the job.
Is there a similar env in pbspro ? Thanks