Skip to content

Commit

Permalink
Merge pull request #555 from xylar/update_to_1.2.0-alpha.5
Browse files Browse the repository at this point in the history
Update to v1.2.0-alpha.5
  • Loading branch information
xylar authored Apr 7, 2023
2 parents f8c8106 + 26093a1 commit 8160b2f
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 349 deletions.
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
exclude: conda/recipe

# Can run individually with `pre-commit run isort --all-files`
- repo: https://github.com/PyCQA/isort
Expand Down
7 changes: 3 additions & 4 deletions compass/machines/chicoma-cpu.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[paths]

# A shared root directory where MPAS standalone data can be found
database_root = /usr/projects/regionalclimate/COMMON_MPAS/mpas_standalonedata/
database_root = /usr/projects/e3sm/mpas_standalonedata/

# the path to the base conda environment where compass environments have
# been created
compass_envs = /usr/projects/climate/SHARED_CLIMATE/compass/chicoma-cpu/base
compass_envs = /usr/projects/e3sm/compass/chicoma-cpu/base


# Options related to deploying a compass conda environment on supported
Expand All @@ -22,7 +22,7 @@ compiler = gnu
mpi_gnu = mpich

# the base path for spack environments used by compass
spack = /usr/projects/climate/SHARED_CLIMATE/compass/chicoma-cpu/spack
spack = /usr/projects/e3sm/compass/chicoma-cpu/spack

# whether to use the same modules for hdf5, netcdf-c, netcdf-fortran and
# pnetcdf as E3SM (spack modules are used otherwise)
Expand Down Expand Up @@ -51,4 +51,3 @@ partition = standard

# The job quality of service (QOS) to use
qos = standard

43 changes: 0 additions & 43 deletions compass/machines/cori-haswell.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion compass/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.0-alpha.4'
__version__ = '1.2.0-alpha.5'
3 changes: 0 additions & 3 deletions conda/albany_supported.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# a list of supported machine, compiler and mpi combinations for Albany

anvil, gnu, openmpi
chicoma-cpu, gnu, mpich
chrysalis, gnu, openmpi
compy, gnu, openmpi
cori-haswell, gnu, mpt
pm-cpu, gnu, mpich
47 changes: 29 additions & 18 deletions conda/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
get_logger,
get_spack_base,
install_miniconda,
log_message,
parse_args,
)

Expand Down Expand Up @@ -190,11 +191,9 @@ def get_env_setup(args, config, machine, compiler, mpi, env_type, source_path,

if args.with_petsc:
lib_suffix = f'{lib_suffix}_petsc'
message = 'Turning off OpenMP because it doesn\'t work well with PETSc'
if logger is None:
print(message)
else:
logger.info(message)
log_message(
logger,
'Turning off OpenMP because it doesn\'t work well with PETSc')
args.without_openmp = True
else:
config.set('deploy', 'petsc', 'None')
Expand Down Expand Up @@ -389,6 +388,7 @@ def build_spack_env(config, update_spack, machine, compiler, mpi, spack_env,
spack_base, spack_template_path, env_vars, tmpdir, logger):

albany = config.get('deploy', 'albany')
cmake = config.get('deploy', 'cmake')
esmf = config.get('deploy', 'esmf')
lapack = config.get('deploy', 'lapack')
petsc = config.get('deploy', 'petsc')
Expand All @@ -398,39 +398,46 @@ def build_spack_env(config, update_spack, machine, compiler, mpi, spack_env,

specs = list()

if cmake != 'None':
specs.append(f'cmake "@{cmake}"')

e3sm_hdf5_netcdf = config.getboolean('deploy', 'use_e3sm_hdf5_netcdf')
if not e3sm_hdf5_netcdf:
hdf5 = config.get('deploy', 'hdf5')
netcdf_c = config.get('deploy', 'netcdf_c')
netcdf_fortran = config.get('deploy', 'netcdf_fortran')
pnetcdf = config.get('deploy', 'pnetcdf')
specs.extend([
f'hdf5@{hdf5}+cxx+fortran+hl+mpi+shared',
f'netcdf-c@{netcdf_c}+mpi~parallel-netcdf',
f'netcdf-fortran@{netcdf_fortran}',
f'parallel-netcdf@{pnetcdf}+cxx+fortran'])
f'hdf5 "@{hdf5}+cxx+fortran+hl+mpi+shared"',
f'netcdf-c "@{netcdf_c}+mpi~parallel-netcdf"',
f'netcdf-fortran "@{netcdf_fortran}"',
f'parallel-netcdf "@{pnetcdf}+cxx+fortran"'])

if esmf != 'None':
specs.append(f'esmf@{esmf}+mpi+netcdf~pio+pnetcdf')
specs.append(f'esmf "@{esmf}+mpi+netcdf~pio+pnetcdf"')
if lapack != 'None':
specs.append(f'netlib-lapack@{lapack}')
specs.append(f'netlib-lapack "@{lapack}"')
include_e3sm_lapack = False
else:
include_e3sm_lapack = True
if petsc != 'None':
specs.append(f'petsc@{petsc}+mpi+batch')
specs.append(f'petsc "@{petsc}+mpi+batch"')

if scorpio != 'None':
specs.append(
f'scorpio@{scorpio}+pnetcdf~timing+internal-timing~tools+malloc')
f'scorpio '
f'"@{scorpio}+pnetcdf~timing+internal-timing~tools+malloc"')

if albany != 'None':
specs.append(f'albany@{albany}+mpas')
specs.append(f'albany "@{albany}+mpas"')

yaml_template = f'{spack_template_path}/{machine}_{compiler}_{mpi}.yaml'
if not os.path.exists(yaml_template):
yaml_template = None
if update_spack:
home_dir = os.path.expanduser('~')
log_message(logger, 'Removing ~/.spack for safety')
safe_rmtree(os.path.join(home_dir, '.spack'))
make_spack_env(spack_path=spack_branch_base, env_name=spack_env,
spack_specs=specs, compiler=compiler, mpi=mpi,
machine=machine,
Expand Down Expand Up @@ -792,6 +799,13 @@ def check_supported(library, machine, compiler, mpi, source_path):
f'on {machine}')


def safe_rmtree(path):
try:
shutil.rmtree(path)
except OSError:
pass


def main(): # noqa: C901
args = parse_args(bootstrap=True)

Expand Down Expand Up @@ -871,10 +885,7 @@ def main(): # noqa: C901

build_dir = f'conda/build{activ_suffix}'

try:
shutil.rmtree(build_dir)
except OSError:
pass
safe_rmtree(build_dir)
try:
os.makedirs(build_dir)
except FileExistsError:
Expand Down
2 changes: 1 addition & 1 deletion conda/compass_env/spec-file.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jigsawpy=0.3.3
jupyter
lxml
{% if include_mache %}
mache=1.10.0
mache=1.14.0
{% endif %}
matplotlib-base
metis
Expand Down
2 changes: 1 addition & 1 deletion conda/configure_compass_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def main():
if local_mache:
mache = ''
else:
mache = '"mache=1.10.0"'
mache = '"mache=1.14.0"'

setup_install_env(env_name, activate_base, args.use_local, logger,
args.recreate, conda_base, mache)
Expand Down
2 changes: 2 additions & 0 deletions conda/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ mpi = nompi

# the version of various packages to include if using spack
albany = develop
# cmake newer than 3.23.0 needed for Trilinos
cmake = 3.23.0:
esmf = 8.2.0
hdf5 = 1.12.1
lapack = 3.9.1
Expand Down
3 changes: 0 additions & 3 deletions conda/petsc_supported.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ chicoma-cpu, gnu, mpich
chrysalis, intel, openmpi
chrysalis, gnu, openmpi
compy, intel, impi
compy, gnu, openmpi
cori-haswell, intel, mpt
cori-haswell, gnu, mpt
pm-cpu, gnu, mpich
4 changes: 2 additions & 2 deletions conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "compass" %}
{% set version = "1.2.0alpha.4" %}
{% set version = "1.2.0alpha.5" %}
{% set build = 0 %}

{% if mpi == "nompi" %}
Expand Down Expand Up @@ -52,7 +52,7 @@ requirements:
- jigsawpy 0.3.3
- jupyter
- lxml
- mache 1.10.0
- mache 1.14.0
- matplotlib-base
- metis
- mpas_tools 0.19.0
Expand Down
7 changes: 7 additions & 0 deletions conda/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def restore_bashrc():
shutil.move(src, dst)


def log_message(logger, message):
if logger is None:
print(message)
else:
logger.info(message)


def get_logger(name, log_filename):
print(f'Logging to: {log_filename}\n')
try:
Expand Down
1 change: 1 addition & 0 deletions conda/unsupported.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ chrysalis, gnu, impi
chrysalis, oneapi-ifx, openmpi
chrysalis, oneapi-ifx, impi
compy, intel, mvapich2
compy, gnu, openmpi
compy, pgi, impi
compy, pgi, mvapich2
pm-cpu, nvidia, mpich
Expand Down
1 change: 0 additions & 1 deletion docs/design_docs/compass_package.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2208,7 +2208,6 @@ The available machines are listed with:
Machines:
anvil
default
cori-haswell
chrysalis
compy
Expand Down
34 changes: 0 additions & 34 deletions docs/developers_guide/machines/cori.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/developers_guide/machines/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ the MPAS model.
| +------------+-----------+-------------------+
| | gnu | openmpi | gfortran |
+--------------+------------+-----------+-------------------+
| cori-haswell | intel | mpt | intel-cray |
| +------------+-----------+-------------------+
| | gnu | mpt | gnu-cray |
+--------------+------------+-----------+-------------------+
| pm-cpu | gnu | mpich | gnu-cray |
+--------------+------------+-----------+-------------------+

Expand All @@ -79,7 +75,6 @@ Below are specifics for each supported machine
chicoma
chrysalis
compy
cori
perlmutter


Expand Down
Loading

0 comments on commit 8160b2f

Please sign in to comment.