Skip to content

Commit a938aba

Browse files
committed
Add oneapi-ifx to MPI_COMPILERS
1 parent ce4b635 commit a938aba

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

mache/spack/env.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
from mache.spack.shared import _get_yaml_data
1010
from mache.version import __version__
1111

12+
MPI_COMPILERS = {
13+
'gnu': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
14+
'intel': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
15+
'oneapi-ifx': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
16+
'impi': {'mpicc': 'mpiicc', 'mpicxx': 'mpiicpc', 'mpifc': 'mpiifort'},
17+
'cray': {'mpicc': 'cc', 'mpicxx': 'CC', 'mpifc': 'ftn'},
18+
}
19+
1220

1321
def make_spack_env(
1422
spack_path,
@@ -250,29 +258,23 @@ def get_modules_env_vars_and_mpi_compilers(
250258
def _get_mpi_compilers(machine, compiler, mpi, cray_compilers):
251259
"""Get a list of compilers from a yaml file"""
252260

253-
mpi_compilers = {
254-
'gnu': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
255-
'intel': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
256-
'impi': {'mpicc': 'mpiicc', 'mpicxx': 'mpiicpc', 'mpifc': 'mpiifort'},
257-
'cray': {'mpicc': 'cc', 'mpicxx': 'CC', 'mpifc': 'ftn'},
258-
}
259-
260261
mpi_compiler = None
261262
# first, get mpi compilers based on compiler
262-
if compiler in mpi_compilers:
263-
mpi_compiler = mpi_compilers[compiler]
263+
if compiler in MPI_COMPILERS:
264+
mpi_compiler = MPI_COMPILERS[compiler]
264265

265266
# next, get mpi compilers based on mpi (higher priority)
266-
if mpi in mpi_compilers:
267-
mpi_compiler = mpi_compilers[mpi]
267+
if mpi in MPI_COMPILERS:
268+
mpi_compiler = MPI_COMPILERS[mpi]
268269

269270
# finally, get mpi compilers if this is a cray machine (highest priority)
270271
if cray_compilers:
271-
mpi_compiler = mpi_compilers['cray']
272+
mpi_compiler = MPI_COMPILERS['cray']
272273

273274
if mpi_compiler is None:
274275
raise ValueError(
275-
f"Couldn't figure out MPI compilers for {machine} {compiler} {mpi}"
276+
f"Couldn't figure out MPI compiler wrappers for {machine} "
277+
f'{compiler} {mpi}'
276278
)
277279

278280
return mpi_compiler['mpicc'], mpi_compiler['mpicxx'], mpi_compiler['mpifc']

0 commit comments

Comments
 (0)