Skip to content

Commit 059264f

Browse files
committed
Add oneapi-ifx to MPI_COMPILERS
1 parent 239a66a commit 059264f

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
@@ -8,6 +8,14 @@
88
from mache.spack.shared import _get_modules, _get_yaml_data
99
from mache.version import __version__
1010

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

1220
def make_spack_env(
1321
spack_path,
@@ -287,29 +295,23 @@ def get_modules_env_vars_and_mpi_compilers(
287295
def _get_mpi_compilers(machine, compiler, mpi, cray_compilers):
288296
"""Get a list of compilers from a yaml file"""
289297

290-
mpi_compilers = {
291-
'gnu': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
292-
'intel': {'mpicc': 'mpicc', 'mpicxx': 'mpicxx', 'mpifc': 'mpif90'},
293-
'impi': {'mpicc': 'mpiicc', 'mpicxx': 'mpiicpc', 'mpifc': 'mpiifort'},
294-
'cray': {'mpicc': 'cc', 'mpicxx': 'CC', 'mpifc': 'ftn'},
295-
}
296-
297298
mpi_compiler = None
298299
# first, get mpi compilers based on compiler
299-
if compiler in mpi_compilers:
300-
mpi_compiler = mpi_compilers[compiler]
300+
if compiler in MPI_COMPILERS:
301+
mpi_compiler = MPI_COMPILERS[compiler]
301302

302303
# next, get mpi compilers based on mpi (higher priority)
303-
if mpi in mpi_compilers:
304-
mpi_compiler = mpi_compilers[mpi]
304+
if mpi in MPI_COMPILERS:
305+
mpi_compiler = MPI_COMPILERS[mpi]
305306

306307
# finally, get mpi compilers if this is a cray machine (highest priority)
307308
if cray_compilers:
308-
mpi_compiler = mpi_compilers['cray']
309+
mpi_compiler = MPI_COMPILERS['cray']
309310

310311
if mpi_compiler is None:
311312
raise ValueError(
312-
f"Couldn't figure out MPI compilers for {machine} {compiler} {mpi}"
313+
f"Couldn't figure out MPI compiler wrappers for {machine} "
314+
f'{compiler} {mpi}'
313315
)
314316

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

0 commit comments

Comments
 (0)