From 861abb512e7f974cd399d2bcfdf4e22b38db7b4b Mon Sep 17 00:00:00 2001 From: Iman Hosseini Date: Sun, 1 Aug 2021 14:58:24 -0400 Subject: [PATCH] laghos: add variant with compiler optimization (#24910) * add variant with compiler optimization Update package.py to include variant with compiler optimization, benchmarked at A-HUG hackaton to improve major kernel time by roughly 3%. * fix style * Update var/spack/repos/builtin/packages/laghos/package.py Co-authored-by: Adam J. Stewart Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/laghos/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/laghos/package.py b/var/spack/repos/builtin/packages/laghos/package.py index 0f327ceb1c..0082333cd8 100644 --- a/var/spack/repos/builtin/packages/laghos/package.py +++ b/var/spack/repos/builtin/packages/laghos/package.py @@ -28,6 +28,7 @@ class Laghos(MakefilePackage): version('1.0', sha256='af50a126355a41c758fcda335a43fdb0a3cd97e608ba51c485afda3dd84a5b34') variant('metis', default=True, description='Enable/disable METIS support') + variant('ofast', default=False, description="Enable gcc optimization flags") depends_on('mfem+mpi+metis', when='+metis') depends_on('mfem+mpi~metis', when='~metis') @@ -50,7 +51,8 @@ def build_targets(self): targets.append('TEST_MK=%s' % spec['mfem'].package.test_mk) if spec.satisfies('@:2.0'): targets.append('CXX=%s' % spec['mpi'].mpicxx) - + if '+ofast %gcc' in self.spec: + targets.append('CXXFLAGS = -Ofast -finline-functions') return targets # See lib/spack/spack/build_systems/makefile.py