Commit 5178f374 authored by Ambra Di Piano's avatar Ambra Di Piano
Browse files

add slurm to configuration

parent c7ce99d6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -50,3 +50,15 @@ class CheckConfiguration():
        assert (type(self.conf['logging']['level']) == str or type(self.conf['logging']['level']) == int) 
        assert type(self.conf['logging']['logfile']) == str 
        return self
    
    def check_slurm(self):
        keys = ['nodes', 'tasks', 'cpus', 'mem', 'environment', 'name', 'account']
        assert self.conf['slurm'].keys() == keys
        assert type(self.conf['slurm']['nodes']) == int
        assert type(self.conf['slurm']['tasks']) == int
        assert type(self.conf['slurm']['cpus']) == int
        assert type(self.conf['slurm']['mem']) == str 
        assert type(self.conf['slurm']['environment']) == str 
        assert type(self.conf['slurm']['name']) == str 
        assert type(self.conf['slurm']['account']) == str 
        return self
 No newline at end of file
+11 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ simulator:
  prod: prod5-v0.1
  pointing: random
  duration: 10
  samples: 5
  samples: 2
  seed: 1
  model: $TEMPLATES$/crab.xml
  output: /data01/homes/dipiano/astroRT/astrort/testing/tmp
@@ -16,3 +16,13 @@ visibility:
logging:
  level: CRITICAL
  logfile:

slurm:
  nodes: 5
  tasks: 1
  cpus: 2
  mem: 32G
  environment: astrort
  name: test
  account: dipiano
+7 −0
Original line number Diff line number Diff line
@@ -47,3 +47,10 @@ class TestCheckConfiguration:
            CheckConfiguration(configuration=configuration).check_logging()
        except AssertionError as e:
            type(e) == AssertionError

    def test_check_slurm(self, test_conf_file):
        configuration = load_yaml_conf(test_conf_file)
        try:
            CheckConfiguration(configuration=configuration).check_logging()
        except AssertionError as e:
            type(e) == AssertionError
 No newline at end of file