Coverage for mlair/run_modules/partition_check.py: 100%
9 statements
« prev ^ index » next coverage.py v6.4.2, created at 2023-06-01 13:03 +0000
« prev ^ index » next coverage.py v6.4.2, created at 2023-06-01 13:03 +0000
1__author__ = "Felix Kleinert"
2__date__ = '2020-04-07'
4from mlair.run_modules.run_environment import RunEnvironment
7class PartitionCheck(RunEnvironment):
8 """
9 Checking if running on a HPC login node. The only reason to run on login nodes is to download data.
10 Training and validation should happen on compute nodes
12 Note: This Method is highly customised to the HCP-systems in Juelich (FZJ, JSC). When using an other HPC system,
13 make sure to double check the indexing of `self.data_store.get('hostname')'.
14 """
16 def __init__(self):
17 # create run framework
18 super().__init__()
20 self._run()
22 def _run(self):
23 if (self.data_store.get('hostname')[:2] in self.data_store.get('login_nodes')) or (
24 self.data_store.get('hostname')[:6] in self.data_store.get('login_nodes')):
25 raise OSError(
26 'You are on a login node to download data. Use compute nodes and run again if you want to train and validate a model.')