Skip to content

Commit 0325231

Browse files
committed
cudaDeviceCountMin / cudaDeviceCountMin accept expressions
1 parent 932f89f commit 0325231

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cwltool/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,14 +1016,14 @@ def evalResources(
10161016
mn = cast(
10171017
Union[int, float],
10181018
eval_resource(
1019-
builder, cast(Union[str, int, float], resourceReq[a + "Min"])
1019+
builder, cast(Union[str, int, float], rsc[a + "Min"])
10201020
),
10211021
)
10221022
if rsc.get(a + "Max"):
10231023
mx = cast(
10241024
Union[int, float],
10251025
eval_resource(
1026-
builder, cast(Union[str, int, float], resourceReq[a + "Max"])
1026+
builder, cast(Union[str, int, float], rsc[a + "Max"])
10271027
),
10281028
)
10291029
if mn is None:

tests/wf/nvidia-smi.cwl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ requirements:
66
cwltool:CUDARequirement:
77
cudaVersionMin: "1.0"
88
cudaComputeCapability: "1.0"
9-
inputs: []
9+
cudaDeviceCountMin: $(inputs.gpus)
10+
inputs:
11+
gpus:
12+
type: int
13+
default: 1
1014
outputs: []
1115
# Assume this will exit non-zero (resulting in a failing test case) if
1216
# nvidia-smi doesn't detect any devices.

0 commit comments

Comments
 (0)