Completed
Pull Request — master (#173)
by
unknown
27s
created

VerifyGrahamCluster.get_arguments()   A

Complexity

Conditions 4

Size

Total Lines 15

Duplication

Lines 15
Ratio 100 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 4
c 2
b 0
f 0
dl 15
loc 15
rs 9.2
1
import sys
2
3
from verify_slurm_cluster import VerifySlurmCluster, set_defaults
4
5
6 View Code Duplication
class VerifyGrahamCluster(VerifySlurmCluster):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7
8
    WALLTIME = 60
9
    CORES_PER_NODE = 32
10
    GPUS_PER_NODE = 2
11
12
    def get_arguments(self, **kwargs):
13
14
        kwargs = super(VerifyGrahamCluster, self).get_arguments(**kwargs)
15
16
        if kwargs["gpusPerCommand"] == 0:
17
            account = os.environ.get("CPU_SLURM_ACCOUNT")
18
        else:
19
            account = os.environ.get("GPU_SLURM_ACCOUNT")
20
21
        if "sbatchFlags" not in kwargs or len(kwargs["sbatchFlags"]) == 0:
22
            kwargs["sbatchFlags"] = "--account=" + account
23
        else:
24
            kwargs["sbatchFlags"] += " --account=" + account
25
26
        return kwargs
27
28
29
if __name__ == "__main__":
30
    verifications = filter(lambda o: not o.startswith("--"), sys.argv[1:])
31
    VerifyGrahamCluster(debug="--debug" in sys.argv[1:],
32
                        no_fork="--no-fork" in sys.argv[1:]).run_verifications(
33
        filtered_by=verifications)
34