Skip to content

Commit 25eda56

Browse files
authored
Merge branch 'main' into VCUE-743
2 parents 4a7f0ba + fb91e78 commit 25eda56

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

checks/microbenchmarks/mpi/osu/osu_tests.py

+39-18
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ class build_osu_benchmarks(rfm.CompileOnlyRegressionTest):
4747

4848
build_system = 'Autotools'
4949
build_prefix = variable(str)
50+
build_locally = False
5051

5152
#: The fixture object that retrieves the benchmarks
5253
#:
5354
#: :type: :class:`fetch_osu_benchmarks`
5455
#: :scope: *session*
5556
osu_benchmarks = fixture(fetch_osu_benchmarks, scope='session')
5657

57-
# FIXME: version of clang compiler and default gcc not compatible
58-
# with the default cudatoolkit (11.6)
58+
# FIXME: version of clang compiler with the default cudatoolkit
5959
@run_after('setup')
6060
def skip_incompatible_envs_cuda(self):
6161
if self.build_type == 'cuda':
62-
if self.current_environ.name in {'PrgEnv-cray', 'PrgEnv-gnu'}:
62+
if self.current_environ.name in {'PrgEnv-cray'}:
6363
self.skip(
6464
f'environ {self.current_environ.name!r} incompatible with'
6565
f'default cudatoolkit')
@@ -69,32 +69,37 @@ def setup_compilers(self):
6969
if self.build_type == 'cuda':
7070
curr_part = self.current_partition
7171
gpu_arch = curr_part.select_devices('gpu')[0].arch
72-
73-
74-
if self.current_environ.name != 'PrgEnv-nvhpc':
75-
self.build_system.ldflags = [
76-
'${CRAY_CUDATOOLKIT_POST_LINK_OPTS}',
77-
'-L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_cuda'
78-
]
72+
environ_name = self.current_environ.name
73+
74+
if environ_name.startswith('PrgEnv-'):
75+
if environ_name != 'PrgEnv-nvhpc':
76+
self.build_system.ldflags = [
77+
'${CRAY_CUDATOOLKIT_POST_LINK_OPTS}',
78+
'-L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_cuda'
79+
]
80+
else:
81+
self.build_system.ldflags = [
82+
'-L${CRAY_NVIDIA_PREFIX}/cuda/lib64',
83+
'-L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_cuda'
84+
]
7985
else:
8086
self.build_system.ldflags = [
81-
'-L${CRAY_NVIDIA_PREFIX}/cuda/lib64',
82-
'-L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_cuda'
87+
'-L${CUDA_HOME}/lib64',
88+
]
89+
self.build_system.cppflags = [
90+
'-I${CUDA_HOME}/include',
8391
]
8492

8593
# Remove the '^sm_' prefix from the arch, e.g sm_80 -> 80
8694
if gpu_arch.startswith('sm_'):
8795
accel_compute_capability = gpu_arch[len('sm_'):]
88-
else:
89-
accel_compute_capability = '80'
9096

9197
if self.current_environ.name in {'PrgEnv-cray', 'PrgEnv-gnu'}:
9298
self.modules = [
9399
'cudatoolkit',
94100
f'craype-accel-nvidia{accel_compute_capability}'
95101
]
96102

97-
98103
@run_before('compile')
99104
def prepare_build(self):
100105
tarball = f'osu-micro-benchmarks-{self.osu_benchmarks.version}.tar.gz'
@@ -240,10 +245,10 @@ class osu_build_run(osu_benchmark):
240245
def set_valid_systems_envs(self):
241246
build_type = self.osu_binaries.build_type
242247
if build_type == 'cuda':
243-
self.valid_systems = ['+remote +nvgpu -uenv']
248+
self.valid_systems = ['+remote +nvgpu']
244249
self.valid_prog_environs = ['+mpi +cuda']
245250
else:
246-
self.valid_systems = ['+remote -uenv']
251+
self.valid_systems = ['+remote']
247252
self.valid_prog_environs = ['+mpi']
248253

249254
@run_before('run')
@@ -257,6 +262,21 @@ def set_environment(self):
257262
# Use only the first CUDA GPU
258263
'CUDA_VISIBLE_DEVICES': 0,
259264
}
265+
curr_part = self.current_partition
266+
gpu_arch = curr_part.select_devices('gpu')[0].arch
267+
268+
if gpu_arch.startswith('sm_'):
269+
accel_compute_capability = gpu_arch[len('sm_'):]
270+
271+
if self.current_environ.name in {'PrgEnv-cray', 'PrgEnv-gnu'}:
272+
self.modules = [
273+
'cudatoolkit',
274+
f'craype-accel-nvidia{accel_compute_capability}'
275+
]
276+
else:
277+
self.env_vars = {
278+
'MPICH_GPU_SUPPORT_ENABLED': 0
279+
}
260280

261281
@run_before('run')
262282
def prepend_build_prefix(self):
@@ -272,6 +292,7 @@ class osu_pt2pt_check(osu_build_run):
272292
('mpi.pt2pt.standard.osu_bw', 'bandwidth'),
273293
('mpi.pt2pt.standard.osu_latency', 'latency')
274294
], fmt=lambda x: x[0], loggable=True)
295+
275296
allref = {
276297
'mpi.pt2pt.standard.osu_bw': {
277298
'cpu': {
@@ -288,7 +309,7 @@ class osu_pt2pt_check(osu_build_run):
288309
'mpi.pt2pt.standard.osu_latency': {
289310
'cpu': {
290311
'*': {
291-
'latency': (2.0, None, 0.15, 'us')
312+
'latency': (3.8, None, 0.15, 'us')
292313
}
293314
},
294315
'cuda': {

0 commit comments

Comments
 (0)