Skip to content

Commit 9fb5ab6

Browse files
committed
Set properly account in verify_cedar
The tests were failing because the account was not specified
1 parent a3c08c8 commit 9fb5ab6

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

smartdispatch/tests/verify_cedar.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import sys
23

34
from verify_slurm_cluster import VerifySlurmCluster, set_defaults
@@ -11,13 +12,17 @@ class VerifyCedarCluster(VerifySlurmCluster):
1112

1213
def get_arguments(self, **kwargs):
1314

14-
set_defaults(
15-
kwargs,
16-
coresPerCommand=1,
17-
gpusPerCommand=0,
18-
walltime=self.WALLTIME,
19-
coresPerNode=self.CORES_PER_NODE,
20-
gpusPerNode=self.GPUS_PER_NODE)
15+
kwargs = super(VerifyCedarCluster, self).get_arguments(**kwargs)
16+
17+
if kwargs["gpusPerCommand"] == 0:
18+
account = os.environ.get("CPU_SLURM_ACCOUNT")
19+
else:
20+
account = os.environ.get("GPU_SLURM_ACCOUNT")
21+
22+
if "sbatchFlags" not in kwargs or len(kwargs["sbatchFlags"]) == 0:
23+
kwargs["sbatchFlags"] = "--account=" + account
24+
else:
25+
kwargs["sbatchFlags"] += " --account=" + account
2126

2227
return kwargs
2328

0 commit comments

Comments
 (0)