Skip to content

Commit d04830b

Browse files
author
Theofilos Manitaras
committed
Address PR comments
1 parent 15c9a8c commit d04830b

File tree

4 files changed

+47
-35
lines changed

4 files changed

+47
-35
lines changed

cscs-checks/libraries/io/hdf5_compile_run.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@ def __init__(self, lang, linkage):
7676
self.maintainers = ['SO', 'RS']
7777
self.tags = {'production', 'craype'}
7878

79-
@rfm.run_after('setup')
80-
def set_linker_variables(self):
79+
@rfm.run_before('compile')
80+
def cray_linker_workaround(self):
8181
# FIXME: static compilation yields a link error in case of
8282
# PrgEnv-cray(Cray Bug #255707)
83-
if (self.linkage == 'static' and
84-
self.current_system.name == 'dom' and
85-
self.current_environ.name == 'PrgEnv-cray'):
86-
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
87-
'LINKER_AARCH64': '=/usr/bin/ld'}
83+
if not (self.linkage == 'static' and
84+
self.current_system.name == 'dom' and
85+
self.current_environ.name == 'PrgEnv-cray'):
86+
return
87+
88+
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
89+
'LINKER_AARCH64': '/usr/bin/ld'}

cscs-checks/libraries/io/netcdf_compile_run.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,7 @@ def __init__(self, lang, linkage):
4141
self.maintainers = ['AJ', 'SO']
4242
self.tags = {'production', 'craype', 'external-resources'}
4343

44-
@rfm.run_before('compile')
4544
def setflags(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-
5445
if self.current_system.name == 'kesch':
5546
if self.current_environ.name == 'PrgEnv-cray-nompi':
5647
self.modules = ['netcdf/4.4.1.1-gmvolf-17.02',
@@ -91,3 +82,15 @@ def setflags(self):
9182
]
9283
else:
9384
self.build_system.ldflags = ['-%s' % self.linkage]
85+
86+
@rfm.run_before('compile')
87+
def cray_linker_workaround(self):
88+
# FIXME: static compilation yields a link error in case of
89+
# PrgEnv-cray(Cray Bug #255707)
90+
if not (self.linkage == 'static' and
91+
self.current_system.name == 'dom' and
92+
self.current_environ.name == 'PrgEnv-cray'):
93+
return
94+
95+
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
96+
'LINKER_AARCH64': '/usr/bin/ld'}

cscs-checks/libraries/math/scalapack_compile_run.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ def __init__(self, linkage):
2929
self.tags = {'production', 'external-resources'}
3030

3131
@rfm.run_before('compile')
32-
def set_linker_variables(self):
32+
def cray_linker_workaround(self):
3333
# FIXME: static compilation yields a link error in case of
3434
# PrgEnv-cray(Cray Bug #255707)
35-
if (self.linkage == 'static' and
36-
self.current_system.name == 'dom' and
37-
self.current_environ.name == 'PrgEnv-cray'):
38-
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
39-
'LINKER_AARCH64': '=/usr/bin/ld'}
35+
if not (self.linkage == 'static' and
36+
self.current_system.name == 'dom' and
37+
self.current_environ.name == 'PrgEnv-cray'):
38+
return
39+
40+
self.variables.update({'LINKER_X86_64': '/usr/bin/ld',
41+
'LINKER_AARCH64': '/usr/bin/ld'})
4042

4143

4244
@rfm.required_version('>=2.14')
@@ -45,9 +47,6 @@ class ScaLAPACKSanity(ScaLAPACKTest):
4547
def __init__(self, linkage):
4648
super().__init__(linkage)
4749
self.sourcepath = 'scalapack_compile_run.f'
48-
if linkage == 'static':
49-
self.variables['LINKER_X86_64'] = '/usr/bin/ld'
50-
self.variables['LINKER_AARCH64'] = '/usr/bin/ld'
5150

5251
def fortran_float(value):
5352
return float(value.replace('D', 'E'))

cscs-checks/prgenv/helloworld.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ def num_ranks(match):
8484

8585
@rfm.run_before('compile')
8686
def setflags(self):
87-
# FIXME: static compilation yields a link error in case of
88-
# PrgEnv-cray(Cray Bug #255707)
89-
if (self.linkage == 'static' and
90-
self.current_system.name == 'dom' and
91-
self.current_environ.name.startswith('PrgEnv-cray')):
92-
self.variables = {'LINKER_X86_64': '/usr/bin/ld',
93-
'LINKER_AARCH64': '=/usr/bin/ld'}
94-
9587
envname = self.current_environ.name.replace('-nompi', '')
9688
prgenv_flags = self.prgenv_flags[envname]
9789
self.build_system.cflags = prgenv_flags
@@ -107,6 +99,18 @@ def compile_timer_end(self):
10799
elapsed = datetime.now() - self.compilation_time_seconds
108100
self.compilation_time_seconds = elapsed.total_seconds()
109101

102+
@rfm.run_before('compile')
103+
def cray_linker_workaround(self):
104+
# FIXME: static compilation yields a link error in case of
105+
# PrgEnv-cray(Cray Bug #255707)
106+
if not (self.linkage == 'static' and
107+
self.current_system.name == 'dom' and
108+
self.current_environ.name.startswith('PrgEnv-cray')):
109+
return
110+
111+
self.variables.update({'LINKER_X86_64': '/usr/bin/ld',
112+
'LINKER_AARCH64': '/usr/bin/ld'})
113+
110114

111115
@rfm.required_version('>=2.14')
112116
@rfm.parameterized_test(*([lang, linkage]
@@ -164,7 +168,9 @@ def __init__(self, lang, linkage):
164168

165169
# On SLURM there is no need to set OMP_NUM_THREADS if one defines
166170
# num_cpus_per_task, but adding for completeness and portability
167-
self.variables['OMP_NUM_THREADS']: str(self.num_cpus_per_task)
171+
self.variables = {
172+
'OMP_NUM_THREADS': str(self.num_cpus_per_task)
173+
}
168174

169175

170176
@rfm.required_version('>=2.14')
@@ -217,4 +223,6 @@ def __init__(self, lang, linkage):
217223

218224
# On SLURM there is no need to set OMP_NUM_THREADS if one defines
219225
# num_cpus_per_task, but adding for completeness and portability
220-
self.variables['OMP_NUM_THREADS'] = str(self.num_cpus_per_task)
226+
self.variables = {
227+
'OMP_NUM_THREADS': str(self.num_cpus_per_task)
228+
}

0 commit comments

Comments
 (0)