Skip to content

Commit 8fcdb41

Browse files
author
Theofilos Manitaras
committed
Fix failing static linking tests on Dom
* Workaround for Cray Bug #255707.
1 parent 004d3a1 commit 8fcdb41

File tree

4 files changed

+57
-25
lines changed

4 files changed

+57
-25
lines changed

cscs-checks/libraries/io/hdf5_compile_run.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
for linkage in ['static', 'dynamic']))
88
class HDF5Test(rfm.RegressionTest):
99
def __init__(self, lang, linkage):
10-
super().__init__()
1110
lang_names = {
1211
'c': 'C',
1312
'f90': 'Fortran 90'
1413
}
14+
self.linkage = linkage
1515
self.descr = lang_names[lang] + ' HDF5 ' + linkage.capitalize()
1616
self.sourcepath = 'h5ex_d_chunk.' + lang
1717
self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:gpu', 'dom:mc',
@@ -74,3 +74,13 @@ def __init__(self, lang, linkage):
7474

7575
self.maintainers = ['SO', 'RS']
7676
self.tags = {'production', 'craype'}
77+
78+
@rfm.run_after('setup')
79+
def set_linker_variables(self):
80+
# FIXME: static compilation yields a link error in case of
81+
# PrgEnv-cray(Cray Bug #255707)
82+
if (self.linkage == 'static' and
83+
self.current_system.name == 'dom' and
84+
self.current_environ.name == 'PrgEnv-cray'):
85+
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
86+
'LINKER_AARCH64': '=/usr/bin/ld'}

cscs-checks/libraries/io/netcdf_compile_run.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
for linkage in ['dynamic', 'static']))
1010
class NetCDFTest(rfm.RegressionTest):
1111
def __init__(self, lang, linkage):
12-
super().__init__()
1312
lang_names = {
1413
'c': 'C',
1514
'cpp': 'C++',
@@ -42,9 +41,18 @@ def __init__(self, lang, linkage):
4241
self.maintainers = ['AJ', 'SO']
4342
self.tags = {'production', 'craype', 'external-resources'}
4443

45-
def setup(self, partition, environ, **job_opts):
44+
@rfm.run_after('setup')
45+
def set_flags(self):
46+
# FIXME: static compilation yields a link error in case of
47+
# PrgEnv-cray(Cray Bug #255707)
48+
if (self.linkage == 'static' and
49+
self.current_system.name == 'dom' and
50+
self.current_environ.name == 'PrgEnv-cray'):
51+
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
52+
'LINKER_AARCH64': '=/usr/bin/ld'}
53+
4654
if self.current_system.name == 'kesch':
47-
if environ.name == 'PrgEnv-cray-nompi':
55+
if self.current_environ.name == 'PrgEnv-cray-nompi':
4856
self.modules = ['netcdf/4.4.1.1-gmvolf-17.02',
4957
'netcdf-c++/4.3.0-gmvolf-17.02',
5058
'netcdf-fortran/4.4.4-gmvolf-17.02']
@@ -62,7 +70,7 @@ def setup(self, partition, environ, **job_opts):
6270
'-L$EBROOTNETCDFMINFORTRAN/lib64',
6371
'-lnetcdf', '-lnetcdf_c++4', '-lnetcdff'
6472
]
65-
elif environ.name == 'PrgEnv-pgi-nompi':
73+
elif self.current_environ.name == 'PrgEnv-pgi-nompi':
6674
self.modules = ['netcdf/4.6.1-pgi-18.5-gcc-5.4.0-2.26',
6775
'netcdf-c++/4.3.0-pgi-18.5-gcc-5.4.0-2.26',
6876
'netcdf-fortran/4.4.4-pgi-18.5-gcc-5.4.0-2.26']
@@ -83,5 +91,3 @@ def setup(self, partition, environ, **job_opts):
8391
]
8492
else:
8593
self.build_system.ldflags = ['-%s' % self.linkage]
86-
87-
super().setup(partition, environ, **job_opts)

cscs-checks/libraries/math/scalapack_compile_run.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ScaLAPACKTest(rfm.RegressionTest):
88
def __init__(self, linkage):
9-
super().__init__()
9+
self.linkage = linkage
1010
self.sourcesdir = os.path.join(self.current_system.resourcesdir,
1111
'scalapack')
1212
self.valid_systems = ['daint:gpu', 'daint:mc', 'dom:mc',
@@ -29,13 +29,26 @@ def __init__(self, linkage):
2929
self.maintainers = ['CB', 'LM']
3030
self.tags = {'production', 'external-resources'}
3131

32+
@rfm.run_after('setup')
33+
def set_linker_variables(self):
34+
# FIXME: static compilation yields a link error in case of
35+
# PrgEnv-cray(Cray Bug #255707)
36+
if (self.linkage == 'static' and
37+
self.current_system.name == 'dom' and
38+
self.current_environ.name == 'PrgEnv-cray'):
39+
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
40+
'LINKER_AARCH64': '=/usr/bin/ld'}
41+
3242

3343
@rfm.required_version('>=2.14')
3444
@rfm.parameterized_test(['static'], ['dynamic'])
3545
class ScaLAPACKSanity(ScaLAPACKTest):
3646
def __init__(self, linkage):
3747
super().__init__(linkage)
3848
self.sourcepath = 'scalapack_compile_run.f'
49+
if linkage == 'static':
50+
self.variables['LINKER_X86_64'] = '/usr/bin/ld'
51+
self.variables['LINKER_AARCH64'] = '/usr/bin/ld'
3952

4053
def fortran_float(value):
4154
return float(value.replace('D', 'E'))

cscs-checks/prgenv/helloworld.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class HelloWorldBaseTest(rfm.RegressionTest):
88
def __init__(self, variant, lang, linkage):
9-
super().__init__()
9+
self.linkage = linkage
1010
self.variables = {'CRAYPE_LINK_TYPE': linkage}
1111
self.prgenv_flags = {}
1212
self.lang_names = {
@@ -32,11 +32,25 @@ def __init__(self, variant, lang, linkage):
3232
self.valid_prog_environs = []
3333

3434
self.compilation_time_seconds = None
35-
3635
self.maintainers = ['VH', 'EK']
3736
self.tags = {'production', 'craype'}
3837

39-
def setup(self, partition, environ, **job_opts):
38+
def compile(self):
39+
self.compilation_time_seconds = datetime.now()
40+
super().compile()
41+
self.compilation_time_seconds = (
42+
datetime.now() - self.compilation_time_seconds).total_seconds()
43+
44+
@rfm.run_after('setup')
45+
def set_flags(self):
46+
# FIXME: static compilation yields a link error in case of
47+
# PrgEnv-cray(Cray Bug #255707)
48+
if (self.linkage == 'static' and
49+
self.current_system.name == 'dom' and
50+
self.current_environ.name.startswith('PrgEnv-cray')):
51+
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
52+
'LINKER_AARCH64': '=/usr/bin/ld'}
53+
4054
result = sn.findall(r'Hello World from thread \s*(\d+) out '
4155
r'of \s*(\d+) from process \s*(\d+) out of '
4256
r'\s*(\d+)', self.stdout)
@@ -80,18 +94,11 @@ def setup(self, partition, environ, **job_opts):
8094
}
8195
}
8296

83-
envname = environ.name.replace('-nompi', '')
97+
envname = self.current_environ.name.replace('-nompi', '')
8498
prgenv_flags = self.prgenv_flags[envname]
8599
self.build_system.cflags = prgenv_flags
86100
self.build_system.cxxflags = prgenv_flags
87101
self.build_system.fflags = prgenv_flags
88-
super().setup(partition, environ, **job_opts)
89-
90-
def compile(self):
91-
self.compilation_time_seconds = datetime.now()
92-
super().compile()
93-
self.compilation_time_seconds = (
94-
datetime.now() - self.compilation_time_seconds).total_seconds()
95102

96103

97104
@rfm.required_version('>=2.14')
@@ -150,9 +157,7 @@ def __init__(self, lang, linkage):
150157

151158
# On SLURM there is no need to set OMP_NUM_THREADS if one defines
152159
# num_cpus_per_task, but adding for completeness and portability
153-
self.variables = {
154-
'OMP_NUM_THREADS': str(self.num_cpus_per_task)
155-
}
160+
self.variables['OMP_NUM_THREADS']: str(self.num_cpus_per_task)
156161

157162

158163
@rfm.required_version('>=2.14')
@@ -205,6 +210,4 @@ def __init__(self, lang, linkage):
205210

206211
# On SLURM there is no need to set OMP_NUM_THREADS if one defines
207212
# num_cpus_per_task, but adding for completeness and portability
208-
self.variables = {
209-
'OMP_NUM_THREADS': str(self.num_cpus_per_task)
210-
}
213+
self.variables['OMP_NUM_THREADS'] = str(self.num_cpus_per_task)

0 commit comments

Comments
 (0)