Skip to content

Commit 727ee64

Browse files
committed
gpu: test not providing shape file
Signed-off-by: vsoch <[email protected]>
1 parent 66e0f21 commit 727ee64

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

fluxbind/scripts/run_mapping.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if [ -z "$JOB_SHAPE_FILE" ]; then
2121
exit 1
2222
fi
2323

24-
gpus_per_task=${GPUS_PER_TASK:-1}
24+
gpus_per_task=${GPUS_PER_TASK:-0}
2525

2626
# Call the fluxbind helper script to get the target location string (e.g., "core:0" or "UNBOUND")
2727
# It ALWAYS returns a single line in the format: BIND_LOCATION,CUDA_DEVICE_ID
@@ -42,6 +42,8 @@ CUDA_DEVICES="${BIND_INFO#*;}"
4242

4343
if [[ "$CUDA_DEVICES" != "NONE" ]]; then
4444
export CUDA_VISIBLE_DEVICES=$CUDA_DEVICES
45+
export ROCR_VISIBLE_DEVICES=$CUDA_DEVICES
46+
export HIP_VISIBLE_DEVICES=$CUDA_DEVICES
4547
fi
4648

4749
if [[ "${BIND_LOCATION}" == "UNBOUND" ]]; then

fluxbind/shape/shape.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, filepath, machine="machine:0"):
1919
"""
2020
self.machine = machine
2121
self.machine_cpuset = commands.hwloc_calc.get_cpuset(self.machine)
22-
self.data = self.load_file(filepath)
22+
self.data = self.load_file(filepath) or []
2323
# This discovers and cache hardware properties on init
2424
# The expectation is that this is running from the node (task)
2525
self.num_cores = commands.hwloc_calc.count("core", within=self.machine)
@@ -74,11 +74,12 @@ def discover_gpus(self):
7474

7575
return gpus_by_numa
7676

77-
def load_file(self, filepath):
77+
def load_file(self, filepath=None):
7878
"""
7979
Loads and parses the YAML shape file.
8080
"""
81-
return utils.read_yaml(filepath)
81+
if filepath is not None:
82+
return utils.read_yaml(filepath)
8283

8384
@staticmethod
8485
def parse_range(range_str: str) -> set:

0 commit comments

Comments
 (0)