Skip to content
Snippets Groups Projects
Commit 0081d308 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

update PartitionCheck to throw OS Error when executed on login nodes on HDFML

parent e61c97b3
No related branches found
No related tags found
3 merge requests!125Release v0.10.0,!124Update Master to new version v0.10.0,!97Felix issue106 hpc modules for juwels
Pipeline #36639 passed
......@@ -25,8 +25,8 @@ DEFAULT_TRANSFORMATION = {"scope": "data", "method": "standardise", "mean": "est
DEFAULT_PLOT_LIST = ["PlotMonthlySummary", "PlotStationMap", "PlotClimatologicalSkillScore", "PlotTimeSeries",
"PlotCompetitiveSkillScore", "PlotBootstrapSkillScore", "PlotConditionalQuantiles",
"PlotAvailability"]
DEFAULT_HPC_LOGIN_LIST = ["ju", "hdfmll"]
DEFAULT_HPC_HOST_LIST = ["jw", "jr", "hdfmlc"] # first part of node names for Juwels (jw[comp], ju[login]) and Jureca(jr).
DEFAULT_HPC_LOGIN_LIST = ["ju", "hdfmll"] # ju[wels} #hdfmll(ogin)
DEFAULT_HPC_HOST_LIST = ["jw", "hdfmlc"] # first part of node names for Juwels (jw[comp], hdfmlc(ompute).
class ExperimentSetup(RunEnvironment):
......
......@@ -8,6 +8,9 @@ class PartitionCheck(RunEnvironment):
"""
Checking if running on a HPC login node. The only reason to run on login nodes is to download data.
Training and validation should happen on compute nodes
Note: This Method is highly customised to the HCP-systems in Juelich (FZJ, JSC). When using an other HPC system,
make sure to double check the indexing of `self.data_store.get('hostname')'.
"""
def __init__(self):
......@@ -17,7 +20,8 @@ class PartitionCheck(RunEnvironment):
self._run()
def _run(self):
if self.data_store.get('hostname')[:2] in self.data_store.get('login_nodes'):
if (self.data_store.get('hostname')[:2] in self.data_store.get('login_nodes')) or (
self.data_store.get('hostname')[:6] in self.data_store.get('login_nodes')):
raise OSError(
'You are on a login node to download data. Use compute nodes and run again if '
'you want to train and validate a model.')
......@@ -33,7 +33,7 @@ class TestPartitionCheck:
RunEnvironment().__del__()
@pytest.fixture
@mock.patch("src.helpers.get_host", return_value="jwtest")
@mock.patch("src.helpers.get_host", return_value="hdfmlc01")
@mock.patch("getpass.getuser", return_value="testUser")
@mock.patch("os.path.exists", return_value=False)
@mock.patch("os.makedirs", side_effect=None)
......@@ -67,7 +67,7 @@ class TestPartitionCheck:
"validate a model." == \
e.value.args[0]
@mock.patch("src.helpers.get_host", return_value="jwtest")
@mock.patch("src.helpers.get_host", return_value="hdfmlc01")
@mock.patch("getpass.getuser", return_value="testUser")
@mock.patch("os.path.exists", return_value=False)
@mock.patch("os.makedirs", side_effect=None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment