Skip to content

Commit

Permalink
Use integer conversion for Cpus and Gpus
Browse files Browse the repository at this point in the history
The CPUs and GPUs are floats, for some reason.  Convert to integer
which makes it easier to parse with python classad bindings (for example
in the gratia probe)
  • Loading branch information
djw8605 committed Mar 26, 2022
1 parent c4c307c commit a796279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/01-ce-router-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ JOB_ROUTER_TRANSFORM_Cpus @=jrt
SET JobIsRunning (JobStatus =!= 1) && (JobStatus =!= 5)

if $(test_want_whole_node)
SET JOB_GLIDEIN_Cpus "$$([TotalCpus ?: JobCpus])"
SET JOB_GLIDEIN_Cpus "$$([int(TotalCpus ?: JobCpus)])"
# MATCH_EXP_JOB_GLIDEIN_Cpus is based on the value of JOB_GLIDEIN_Cpus once the routed job is matched to an
# HTCondor slot
SET GlideinCpusIsGood int(MATCH_EXP_JOB_GLIDEIN_Cpus ?: "0") isnt error
Expand All @@ -196,7 +196,7 @@ JOB_ROUTER_TRANSFORM_Gpus @=jrt
# GPUs on that machine
REQUIREMENTS RequestGpus isnt undefined
if $(test_want_whole_node)
SET JOB_GLIDEIN_GPUs "$$([TotalGPUs ?: JobGPUs])"
SET JOB_GLIDEIN_GPUs "$$([int(TotalGPUs ?: JobGPUs)])"
# MATCH_EXP_JOB_GLIDEIN_GPUs is based on the value of JOB_GLIDEIN_GPUs once the routed job is matched to an
# HTCondor slot
SET GlideinGPUsIsGood int(MATCH_EXP_JOB_GLIDEIN_GPUs ?: "0") isnt error
Expand Down

0 comments on commit a796279

Please sign in to comment.