Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions cscs-checks/compile/haswell_fma_check.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import os

import reframe as rfm
import reframe.utility.sanity as sn
from reframe.core.pipeline import CompileOnlyRegressionTest


class HaswellFmaCheck(CompileOnlyRegressionTest):
def __init__(self, **kwargs):
super().__init__('haswell_fma_check',
os.path.dirname(__file__), **kwargs)
@rfm.simple_test
class HaswellFmaCheck(rfm.CompileOnlyRegressionTest):
def __init__(self):
super().__init__()
self.descr = 'check for avx2 instructions'
self.valid_systems = ['dom:login', 'daint:login', 'kesch:login']
if self.current_system.name == 'kesch':
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu']
else:
self.valid_prog_environs = ['PrgEnv-cray', 'PrgEnv-gnu',
'PrgEnv-intel', 'PrgEnv-pgi']
self.modules = ['craype-haswell']

self.sourcesdir = 'src/haswell_fma'
self.build_system = 'Make'
self.build_system.cflags = ['-O3', '-S']
self.build_system.cxxflags = ['-O3', '-S']
self.build_system.fflags = ['-O3', '-S']
self.sanity_patterns = sn.all([
sn.assert_found(r'vfmadd', 'vectorize_fma_c.s'),
sn.assert_found(r'vfmadd', 'vectorize_fma_cplusplus.s'),
Expand All @@ -26,21 +30,14 @@ def __init__(self, **kwargs):
self.maintainers = ['AJ', 'VK']
self.tags = {'production'}

def compile(self):
self.current_environ.cflags = '-O3 -S'
self.current_environ.cxxflags = '-O3 -S'
self.current_environ.fflags = '-O3 -S'
def setup(self, partition, environ, **job_opts):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to override setup() here, since you are changing behaviour based on the system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it because the flags change based on the environment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have now seen it.

super().setup(partition, environ, **job_opts)
if self.current_system.name == 'kesch':
if self.current_environ.name == 'PrgEnv-cray':
# Ignore CPATH warning
self.current_environ.cflags += ' -h nomessage=1254'
self.current_environ.cxxflags += ' -h nomessage=1254'
self.build_system.cflags += ['-h nomessage=1254']
self.build_system.cxxflags += ['-h nomessage=1254']
else:
self.current_environ.cflags += ' -march=native'
self.current_environ.cxxflags += ' -march=native'
self.current_environ.fflags += ' -march=native'
super().compile()


def _get_checks(**kwargs):
return [HaswellFmaCheck(**kwargs)]
self.build_system.cflags += ['-march=native']
self.build_system.cxxflags += ['-march=native']
self.build_system.fflags += ['-march=native']