Skip to content
Snippets Groups Projects
Commit 5606fc90 authored by Anne Tipka's avatar Anne Tipka :headphones:
Browse files

included checking for Bologna vs Reading servers and adapted queue and host names

parent 5adaf8a5
Branches
No related tags found
No related merge requests found
......@@ -119,8 +119,8 @@ def check_area(grid, area, upper, lower, left, right):
'''Defines the correct area string.
Checks the format of the four area components wether it is on
the order of 1000 or 1.
Also checks wether area was already set on command line,
the order of 1000 or 1.
Also checks wether area was already set on command line,
then the four components are overwritten.
Convert to correct format of the order of magnitude "1" and sets the
area parameter (North/West/South/East).
......@@ -452,7 +452,7 @@ def check_mail(mail):
def check_queue(queue, gateway, destination, ecuid, ecgid):
'''Check if the necessary ECMWF parameters are set if the queue is
one of the QUEUES_LIST (in _config).
one of the QUEUES_LIST_ALL (in _config).
Parameters
----------
......@@ -478,14 +478,14 @@ def check_queue(queue, gateway, destination, ecuid, ecgid):
------
'''
if queue in _config.QUEUES_LIST and \
if queue in _config.QUEUES_LIST_ALL and \
(not ecuid or not ecgid):
raise ValueError('\nEnvironment variables ECUID '
'and ECGID were not set properly! \n '
'Please check for existence of file "ECMWF_ENV" '
'in the run directory!')
elif queue in _config.QUEUES_LIST and \
(not gateway or not destination):
elif queue in _config.QUEUES_LIST_ALL and \
(not gateway or not destination):
print('WARNING: Parameters GATEWAY and DESTINATION were '
'not properly set for working on ECMWF server. \n'
'There will be no transfer of output files to the '
......
......@@ -10,9 +10,9 @@
# - changed template filenames to .template
# August 2020 - Leopold Haimberger
# - added another target for installation
# - added filename which will contain paths for system version
# - added filename which will contain paths for system version
# - checks if software runs in normal local mode or system local mode
# and defines paths to user directory and executable paths
# and defines paths to user directory and executable paths
#
# @License:
# (C) Copyright 2014-2020.
......@@ -42,11 +42,34 @@ import platform
# PARAMETERS
# ------------------------------------------------------------------------------
_VERSION_STR = '7.1.2_ctbto'
FLAG_ON_ECMWFSERVER = 'ecgb' in platform.node()
_VERSION_STR = '7.1.3'
HOSTNAMES_BOLOGNA_LIST = ['ecs', 'aa', 'ab', 'ac', 'ad']
HOSTNAMES_READING_LIST = ['ecgb', 'cca', 'ccb']
# name of environment variable on ECMWF Bologna servers
# that indicates which cluster / host we are on
HOSTENV_BOLOGNA = 'EC_CLUSTER'
# name of environment variable on ECMWF Reading servers
# that indicates which cluster / host we are on
HOSTENV_READING = 'ECPLATFORM'
# test if we are on a Bologna or Reading server
# Test and set ECMWF Bologna server values
if os.getenv(HOSTENV_BOLOGNA) is not None:
ec_hostname = os.getenv(HOSTENV_BOLOGNA)
FLAG_ON_ECMWFSERVER = ec_hostname in HOSTNAMES_BOLOGNA_LIST
QUEUES_LIST = ['ecs', 'ecs-login', 'hpc', 'hpc-login', 'hpc-2020']
# Test and set ECMWF Reading server values
elif os.getenv(HOSTENV_READING) is not None:
ec_hostname = os.getenv(HOSTENV_READING)
FLAG_ON_ECMWFSERVER = ec_hostname in HOSTNAMES_READING_LIST
QUEUES_LIST = ['ecgate', 'cca', 'ccb']
else:
FLAG_ON_ECMWFSERVER = False
QUEUES_LIST = ['ecgate', 'cca', 'ccb']
QUEUES_LIST_ALL = ['ecs', 'ecs-login', 'hpc', 'hpc-login', 'hpc-2020', 'ecgate', 'cca', 'ccb']
INSTALL_TARGETS = ['local', 'syslocal', 'ecgate', 'cca', 'ccb']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment