Skip to content

Commit 90dae2d

Browse files
committed
Merge branch 'develop' into sanity_check_only
2 parents d1cbe3a + 7123af1 commit 90dae2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2058
-426
lines changed

.github/workflows/bootstrap_script.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
runs-on: ubuntu-18.04
1818
strategy:
1919
matrix:
20-
python: [2.7, 3.6, 3.7, 3.8, 3.9]
20+
# Don't run for Python 3.8, 3.9 , people should just use `pip install easybuild`
21+
python: [2.7, 3.6, 3.7]
2122
modules_tool:
2223
# use variables defined by 'setup' job above, see also
2324
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context

contrib/hooks/hpc2n_hooks.py

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -162,21 +162,19 @@ def pre_module_hook(self, *args, **kwargs):
162162
self.log.info("[pre-module hook] Set I_MPI_PMI_LIBRARY in impi module")
163163
# Must be done this way, updating self.cfg['modextravars']
164164
# directly doesn't work due to templating.
165-
en_templ = self.cfg.enable_templating
166-
self.cfg.enable_templating = False
167-
shlib_ext = get_shared_lib_ext()
168-
pmix_root = get_software_root('PMIx')
169-
if pmix_root:
170-
mpi_type = 'pmix_v3'
171-
self.cfg['modextravars'].update({
172-
'I_MPI_PMI_LIBRARY': os.path.join(pmix_root, "lib", "libpmi." + shlib_ext)
173-
})
174-
self.cfg['modextravars'].update({'SLURM_MPI_TYPE': mpi_type})
175-
# Unfortunately UCX doesn't yet work for unknown reasons. Make sure it is off.
176-
self.cfg['modextravars'].update({'SLURM_PMIX_DIRECT_CONN_UCX': 'false'})
177-
else:
178-
self.cfg['modextravars'].update({'I_MPI_PMI_LIBRARY': "/lap/slurm/lib/libpmi.so"})
179-
self.cfg.enable_templating = en_templ
165+
with self.cfg.disable_templating():
166+
shlib_ext = get_shared_lib_ext()
167+
pmix_root = get_software_root('PMIx')
168+
if pmix_root:
169+
mpi_type = 'pmix_v3'
170+
self.cfg['modextravars'].update({
171+
'I_MPI_PMI_LIBRARY': os.path.join(pmix_root, "lib", "libpmi." + shlib_ext)
172+
})
173+
self.cfg['modextravars'].update({'SLURM_MPI_TYPE': mpi_type})
174+
# Unfortunately UCX doesn't yet work for unknown reasons. Make sure it is off.
175+
self.cfg['modextravars'].update({'SLURM_PMIX_DIRECT_CONN_UCX': 'false'})
176+
else:
177+
self.cfg['modextravars'].update({'I_MPI_PMI_LIBRARY': "/lap/slurm/lib/libpmi.so"})
180178

181179
if self.name == 'OpenBLAS':
182180
self.log.info("[pre-module hook] Set OMP_NUM_THREADS=1 in OpenBLAS module")
@@ -197,18 +195,14 @@ def pre_module_hook(self, *args, **kwargs):
197195
self.log.info("[pre-module hook] Set SLURM_MPI_TYPE=%s in OpenMPI module" % mpi_type)
198196
# Must be done this way, updating self.cfg['modextravars']
199197
# directly doesn't work due to templating.
200-
en_templ = self.cfg.enable_templating
201-
self.cfg.enable_templating = False
202-
self.cfg['modextravars'].update({'SLURM_MPI_TYPE': mpi_type})
203-
# Unfortunately UCX doesn't yet work for unknown reasons. Make sure it is off.
204-
self.cfg['modextravars'].update({'SLURM_PMIX_DIRECT_CONN_UCX': 'false'})
205-
self.cfg.enable_templating = en_templ
198+
with self.cfg.disable_templating():
199+
self.cfg['modextravars'].update({'SLURM_MPI_TYPE': mpi_type})
200+
# Unfortunately UCX doesn't yet work for unknown reasons. Make sure it is off.
201+
self.cfg['modextravars'].update({'SLURM_PMIX_DIRECT_CONN_UCX': 'false'})
206202

207203
if self.name == 'PMIx':
208204
# This is a, hopefully, temporary workaround for https://github.com/pmix/pmix/issues/1114
209205
if LooseVersion(self.version) > LooseVersion('2') and LooseVersion(self.version) < LooseVersion('3'):
210206
self.log.info("[pre-module hook] Set PMIX_MCA_gds=^ds21 in PMIx module")
211-
en_templ = self.cfg.enable_templating
212-
self.cfg.enable_templating = False
213-
self.cfg['modextravars'].update({'PMIX_MCA_gds': '^ds21'})
214-
self.cfg.enable_templating = en_templ
207+
with self.cfg.disable_templating():
208+
self.cfg['modextravars'].update({'PMIX_MCA_gds': '^ds21'})

easybuild/base/generaloption.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,30 @@
4040
from functools import reduce
4141
from optparse import Option, OptionGroup, OptionParser, OptionValueError, Values
4242
from optparse import SUPPRESS_HELP as nohelp # supported in optparse of python v2.4
43-
from optparse import gettext as _gettext # this is gettext.gettext normally
4443

4544
from easybuild.base.fancylogger import getLogger, setroot, setLogLevel, getDetailsLogLevels
4645
from easybuild.base.optcomplete import autocomplete, CompleterOption
4746
from easybuild.tools.py2vs3 import StringIO, configparser, string_type
4847
from easybuild.tools.utilities import mk_rst_table, nub, shell_quote
4948

49+
try:
50+
import gettext
51+
eb_translation = None
52+
53+
def get_translation():
54+
global eb_translation
55+
if not eb_translation:
56+
# Finding a translation is expensive, so do only once
57+
domain = gettext.textdomain()
58+
eb_translation = gettext.translation(domain, gettext.bindtextdomain(domain), fallback=True)
59+
return eb_translation
60+
61+
def _gettext(message):
62+
return get_translation().gettext(message)
63+
except ImportError:
64+
def _gettext(message):
65+
return message
66+
5067

5168
HELP_OUTPUT_FORMATS = ['', 'rst', 'short', 'config']
5269

0 commit comments

Comments
 (0)