Exemplo n.º 1
0
    def setUp(self):
        idle_node_description = ()

        idle_drained_node_description = ()

        no_partition_node_description = ()

        self.no_name_node_description = ()

        self.allocated_node = _SlurmNode(allocated_node_description)
        self.allocated_node_copy = _SlurmNode(allocated_node_description)
        self.idle_node = _SlurmNode(idle_node_description)
        self.idle_drained = _SlurmNode(idle_drained_node_description)
        self.no_partition_node = _SlurmNode(no_partition_node_description)
Exemplo n.º 2
0
def test_slurm_node_noname():
    with pytest.raises(JobSchedulerError):
        _SlurmNode('Arch=x86_64 CoresPerSocket=12 '
                   'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
                   'AvailableFeatures=f1,f2 ActiveFeatures=f1,f2 '
                   'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00001 '
                   'NodeHostName=nid00001 Version=10.00 OS=Linux '
                   'RealMemory=32220 AllocMem=0 FreeMem=10000 '
                   'Sockets=1 Boards=1 State=IDLE+DRAIN '
                   'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
                   'MCS_label=N/A Partitions=p1,p2 '
                   'BootTime=01 Jan 2018 '
                   'SlurmdStartTime=01 Jan 2018 '
                   'CfgTRES=cpu=24,mem=32220M '
                   'AllocTRES= CapWatts=n/a CurrentWatts=100 '
                   'LowestJoules=100000000 ConsumedJoules=0 '
                   'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
                   'ExtSensorsTemp=n/s Reason=Foo/ '
                   'failed [reframe_user@01 Jan 2018]')
Exemplo n.º 3
0
def slurm_node_maintenance():
    return _SlurmNode('NodeName=nid00006 Arch=x86_64 CoresPerSocket=12 '
                      'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
                      'AvailableFeatures=f6 ActiveFeatures=f6 '
                      'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00006'
                      'NodeHostName=nid00006 Version=10.00 OS=Linux '
                      'RealMemory=32220 AllocMem=0 FreeMem=10000 '
                      'Sockets=1 Boards=1 State=MAINT '
                      'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
                      'MCS_label=N/A Partitions=p4 '
                      'BootTime=01 Jan 2018 '
                      'SlurmdStartTime=01 Jan 2018 '
                      'CfgTRES=cpu=24,mem=32220M '
                      'AllocTRES= CapWatts=n/a CurrentWatts=100 '
                      'LowestJoules=100000000 ConsumedJoules=0 '
                      'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
                      'ExtSensorsTemp=n/s Reason=Foo/ '
                      'failed [reframe_user@01 Jan 2018]')
Exemplo n.º 4
0
def test_hash(slurm_node_allocated):
    assert (hash(slurm_node_allocated) == hash(
        _SlurmNode(slurm_node_allocated.descr)))
Exemplo n.º 5
0
def test_slurm_node_equals(slurm_node_allocated, slurm_node_idle):
    assert slurm_node_allocated == _SlurmNode(slurm_node_allocated.descr)
    assert slurm_node_allocated != slurm_node_idle
Exemplo n.º 6
0
 def test_no_node_name(self):
     with pytest.raises(JobError):
         _SlurmNode(self.no_name_node_description)
Exemplo n.º 7
0
    def setUp(self):
        allocated_node_description = (
            'NodeName=nid00001 Arch=x86_64 CoresPerSocket=12 '
            'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
            'AvailableFeatures=f1,f2 ActiveFeatures=f1,f2 '
            'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00001 '
            'NodeHostName=nid00001 Version=10.00 OS=Linux '
            'RealMemory=32220 AllocMem=0 FreeMem=10000 '
            'Sockets=1 Boards=1 State=ALLOCATED '
            'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
            'MCS_label=N/A Partitions=p1,p2 '
            'BootTime=01 Jan 2018 '
            'SlurmdStartTime=01 Jan 2018 '
            'CfgTRES=cpu=24,mem=32220M '
            'AllocTRES= CapWatts=n/a CurrentWatts=100 '
            'LowestJoules=100000000 ConsumedJoules=0 '
            'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
            'ExtSensorsTemp=n/s Reason=Foo/ '
            'failed [reframe_user@01 Jan 2018]')

        idle_node_description = (
            'NodeName=nid00002 Arch=x86_64 CoresPerSocket=12 '
            'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
            'AvailableFeatures=f1,f2 ActiveFeatures=f1,f2 '
            'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00001 '
            'NodeHostName=nid00001 Version=10.00 OS=Linux '
            'RealMemory=32220 AllocMem=0 FreeMem=10000 '
            'Sockets=1 Boards=1 State=IDLE '
            'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
            'MCS_label=N/A Partitions=p1,p2 '
            'BootTime=01 Jan 2018 '
            'SlurmdStartTime=01 Jan 2018 '
            'CfgTRES=cpu=24,mem=32220M '
            'AllocTRES= CapWatts=n/a CurrentWatts=100 '
            'LowestJoules=100000000 ConsumedJoules=0 '
            'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
            'ExtSensorsTemp=n/s Reason=Foo/ '
            'failed [reframe_user@01 Jan 2018]')

        idle_drained_node_description = (
            'NodeName=nid00003 Arch=x86_64 CoresPerSocket=12 '
            'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
            'AvailableFeatures=f1,f2 ActiveFeatures=f1,f2 '
            'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00001 '
            'NodeHostName=nid00001 Version=10.00 OS=Linux '
            'RealMemory=32220 AllocMem=0 FreeMem=10000 '
            'Sockets=1 Boards=1 State=IDLE+DRAIN '
            'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
            'MCS_label=N/A Partitions=p1,p2 '
            'BootTime=01 Jan 2018 '
            'SlurmdStartTime=01 Jan 2018 '
            'CfgTRES=cpu=24,mem=32220M '
            'AllocTRES= CapWatts=n/a CurrentWatts=100 '
            'LowestJoules=100000000 ConsumedJoules=0 '
            'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
            'ExtSensorsTemp=n/s Reason=Foo/ '
            'failed [reframe_user@01 Jan 2018]')

        no_partition_node_description = (
            'NodeName=nid00004 Arch=x86_64 CoresPerSocket=12 '
            'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
            'AvailableFeatures=f1,f2 ActiveFeatures=f1,f2 '
            'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00001 '
            'NodeHostName=nid00001 Version=10.00 OS=Linux '
            'RealMemory=32220 AllocMem=0 FreeMem=10000 '
            'Sockets=1 Boards=1 State=IDLE+DRAIN '
            'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
            'MCS_label=N/A BootTime=01 Jan 2018 '
            'SlurmdStartTime=01 Jan 2018 '
            'CfgTRES=cpu=24,mem=32220M '
            'AllocTRES= CapWatts=n/a CurrentWatts=100 '
            'LowestJoules=100000000 ConsumedJoules=0 '
            'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
            'ExtSensorsTemp=n/s Reason=Foo/ '
            'failed [reframe_user@01 Jan 2018]')

        self.no_name_node_description = (
            'Arch=x86_64 CoresPerSocket=12 '
            'CPUAlloc=0 CPUErr=0 CPUTot=24 CPULoad=0.00 '
            'AvailableFeatures=f1,f2 ActiveFeatures=f1,f2 '
            'Gres=gpu_mem:16280,gpu:1 NodeAddr=nid00001 '
            'NodeHostName=nid00001 Version=10.00 OS=Linux '
            'RealMemory=32220 AllocMem=0 FreeMem=10000 '
            'Sockets=1 Boards=1 State=IDLE+DRAIN '
            'ThreadsPerCore=2 TmpDisk=0 Weight=1 Owner=N/A '
            'MCS_label=N/A Partitions=p1,p2 '
            'BootTime=01 Jan 2018 '
            'SlurmdStartTime=01 Jan 2018 '
            'CfgTRES=cpu=24,mem=32220M '
            'AllocTRES= CapWatts=n/a CurrentWatts=100 '
            'LowestJoules=100000000 ConsumedJoules=0 '
            'ExtSensorsJoules=n/s ExtSensorsWatts=0 '
            'ExtSensorsTemp=n/s Reason=Foo/ '
            'failed [reframe_user@01 Jan 2018]')

        self.allocated_node = _SlurmNode(allocated_node_description)
        self.allocated_node_copy = _SlurmNode(allocated_node_description)
        self.idle_node = _SlurmNode(idle_node_description)
        self.idle_drained = _SlurmNode(idle_drained_node_description)
        self.no_partition_node = _SlurmNode(no_partition_node_description)
Exemplo n.º 8
0
 def test_no_node_name(self):
     with self.assertRaises(JobError):
         _SlurmNode(self.no_name_node_description)