summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIman Hosseini <ImanHosseini@users.noreply.github.com>2021-08-01 14:58:24 -0400
committerGitHub <noreply@github.com>2021-08-01 18:58:24 +0000
commit861abb512e7f974cd399d2bcfdf4e22b38db7b4b (patch)
treeb673df333575dd087284942f318cc49ca086cdc0
parent8867827a89bffea655031c839a2f88c5fc6ae367 (diff)
downloadspack-861abb512e7f974cd399d2bcfdf4e22b38db7b4b.tar.gz
spack-861abb512e7f974cd399d2bcfdf4e22b38db7b4b.tar.bz2
spack-861abb512e7f974cd399d2bcfdf4e22b38db7b4b.tar.xz
spack-861abb512e7f974cd399d2bcfdf4e22b38db7b4b.zip
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 <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/laghos/package.py4
1 files changed, 3 insertions, 1 deletions
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 @@ class Laghos(MakefilePackage):
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