Skip to content

Commit

Permalink
Add PBS environment detection - PBS_RESC_MEM and PBS_NCPUS. Issue #1912.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Mar 31, 2021
1 parent 8ebd75b commit 404540a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/pipelines/canu/Grid_Local.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ sub getNumberOfCPUs () {
$ncpu = $ENV{"SLURM_JOB_CPUS_PER_NODE"};
}

if (exists($ENV{"PBS_NCPUS"})) {
$ncpu = $ENV{"PBS_NCPUS"};
}

if (exists($ENV{"PBS_NUM_PPN"})) {
$ncpu = $ENV{"PBS_NUM_PPN"};
}
Expand Down Expand Up @@ -114,6 +118,10 @@ sub getPhysicalMemorySize () {
$memory = $ENV{"SLURM_MEM_PER_NODE"};
}

if (exists($ENV{"PBS_RESC_MEM"})) {
$memory = $ENV{"PBS_RESC_MEM"} / 1024 / 1024 / 1024;
}

return(int($memory + 0.5)); # Poor man's rounding
}

Expand Down
2 changes: 1 addition & 1 deletion src/utility
Submodule utility updated 1 files
+31 −14 src/utility/system.C

0 comments on commit 404540a

Please # to comment.