From 998de97091d509ad890c5781a246611332dc366d Mon Sep 17 00:00:00 2001 From: Timothy Brown Date: Mon, 13 Sep 2021 16:13:43 -0600 Subject: [PATCH] ESMF, NEMSIO and UFS-UTILS changes. (#25846) * ESMF and NEMSIO changes. - Updating ESMF to set the COMM correctly when using Intel oneapi. - Explicitly setting the CMake MPI Fortran compiler for NEMSIO. * Update UFS utils CMake to use MPI__COMPILER. --- var/spack/repos/builtin/packages/esmf/package.py | 4 +++- var/spack/repos/builtin/packages/nemsio/package.py | 3 +++ var/spack/repos/builtin/packages/ufs-utils/package.py | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/esmf/package.py b/var/spack/repos/builtin/packages/esmf/package.py index a00e49ee90..3f65662ae7 100644 --- a/var/spack/repos/builtin/packages/esmf/package.py +++ b/var/spack/repos/builtin/packages/esmf/package.py @@ -176,7 +176,9 @@ def edit(self, spec, prefix): os.environ['ESMF_CXXLINKLIBS'] = '-lmpifort' elif '^openmpi' in spec: os.environ['ESMF_COMM'] = 'openmpi' - elif '^intel-parallel-studio+mpi' in spec or '^intel-mpi' in spec: + elif '^intel-parallel-studio+mpi' in spec or \ + '^intel-mpi' in spec or \ + '^intel-oneapi-mpi' in spec: os.environ['ESMF_COMM'] = 'intelmpi' else: # Force use of the single-processor MPI-bypass library. diff --git a/var/spack/repos/builtin/packages/nemsio/package.py b/var/spack/repos/builtin/packages/nemsio/package.py index 76edd7d734..d31ffc85ae 100644 --- a/var/spack/repos/builtin/packages/nemsio/package.py +++ b/var/spack/repos/builtin/packages/nemsio/package.py @@ -21,3 +21,6 @@ class Nemsio(CMakePackage): depends_on('bacio') depends_on('mpi') depends_on('w3nco') + + def cmake_args(self): + return ['-DMPI_Fortran_COMPILER=%s' % self.spec['mpi'].mpifc] diff --git a/var/spack/repos/builtin/packages/ufs-utils/package.py b/var/spack/repos/builtin/packages/ufs-utils/package.py index b1de6c9eb1..f430687c46 100644 --- a/var/spack/repos/builtin/packages/ufs-utils/package.py +++ b/var/spack/repos/builtin/packages/ufs-utils/package.py @@ -35,5 +35,9 @@ class UfsUtils(CMakePackage): depends_on('wgrib2') depends_on('zlib') + def cmake_args(self): + return ['-DMPI_C_COMPILER=%s' % self.spec['mpi'].mpicc, + '-DMPI_Fortran_COMPILER=%s' % self.spec['mpi'].mpifc] + def setup_build_environment(self, env): env.set('ESMFMKFILE', join_path(self.spec['esmf'].prefix.lib, 'esmf.mk'))