Updating amrvis to allow building with profiling support. (#9204)

* Updating amrvis to allow building with profiling support.
* Setting MPI default to true.
This commit is contained in:
Jon Rood 2018-09-14 18:16:35 -06:00 committed by Todd Gamblin
parent ae1420bffc
commit 8f80ee7a40

View File

@ -52,6 +52,8 @@ class Amrvis(MakefilePackage):
)
variant('mpi', default=True, description='Enable MPI parallel support')
variant('debug', default=False, description='Enable debugging features')
variant('profiling', default=False,
description='Enable AMReX profiling features')
depends_on('gmake', type='build')
depends_on('mpi', when='+mpi')
@ -62,6 +64,17 @@ class Amrvis(MakefilePackage):
depends_on('libxt')
depends_on('libxext')
depends_on('motif')
depends_on('flex')
depends_on('bison')
conflicts(
'+profiling', when='dims=1',
msg='Amrvis profiling support requires a 2D build'
)
conflicts(
'+profiling', when='dims=3',
msg='Amrvis profiling support requires a 2D build'
)
# Only doing gcc and clang at the moment.
# Intel currently fails searching for mpiicc, mpiicpc, etc.
@ -81,7 +94,7 @@ def edit(self, spec, prefix):
# Set all available makefile options to values we want
makefile = FileFilter('GNUmakefile')
makefile.filter(
r'^AMREX_HOME\s*=.*',
r'^AMREX_HOME\s*\?=.*',
'AMREX_HOME = {0}'.format('./amrex')
)
makefile.filter(
@ -94,15 +107,21 @@ def edit(self, spec, prefix):
)
makefile.filter(
r'^PROFILE\s*=.*',
'PROFILE = FALSE'
'PROFILE = {0}'.format(
spec.variants['profiling'].value
).upper()
)
makefile.filter(
r'^TRACE_PROFILE\s*=.*',
'TRACE_PROFILE = FALSE'
'TRACE_PROFILE = {0}'.format(
spec.variants['profiling'].value
).upper()
)
makefile.filter(
r'^COMM_PROFILE\s*=.*',
'COMM_PROFILE = FALSE'
'COMM_PROFILE = {0}'.format(
spec.variants['profiling'].value
).upper()
)
makefile.filter(
r'^COMP\s*=.*',
@ -134,7 +153,9 @@ def edit(self, spec, prefix):
)
makefile.filter(
r'^USE_PROFPARSER\s*=.*',
'USE_PROFPARSER = FALSE'
'USE_PROFPARSER = {0}'.format(
spec.variants['profiling'].value
).upper()
)
# A bit risky here deleting all /usr and /opt X
@ -171,6 +192,8 @@ def edit(self, spec, prefix):
file.writelines(contents)
def setup_environment(self, spack_env, run_env):
# We don't want an AMREX_HOME the user may have set already
spack_env.unset('AMREX_HOME')
# Help force Amrvis to not pick up random system compilers
if '+mpi' in self.spec:
spack_env.set('MPI_HOME', self.spec['mpi'].prefix)