From 5faf1d8407c17a0b005c1939f92767b937ead590 Mon Sep 17 00:00:00 2001 From: Jack Betteridge Date: Thu, 30 Apr 2026 13:03:31 +0100 Subject: [PATCH] compiler: Add support for IBM Spectrum MPI --- devito/arch/compiler.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/devito/arch/compiler.py b/devito/arch/compiler.py index 17cdc91a0f..58b1e30204 100644 --- a/devito/arch/compiler.py +++ b/devito/arch/compiler.py @@ -116,6 +116,8 @@ def sniff_mpi_distro(mpiexec): return 'MPICH' elif "Intel(R) MPI" in ver: return 'IntelMPI' + elif "IBM Spectrum MPI" in ver: + return "SpectrumMPI" except (CalledProcessError, UnicodeDecodeError): pass return 'unknown' @@ -124,14 +126,16 @@ def sniff_mpi_distro(mpiexec): @memoized_func def sniff_mpi_flags(mpicc='mpicc'): mpi_distro = sniff_mpi_distro('mpiexec') - if mpi_distro != 'OpenMPI': + if mpi_distro in ['OpenMPI', 'SpectrumMPI']: + # OpenMPI's CC wrapper, namely mpicc, takes the --showme argument to find out + # the flags used for compiling and linking + compile_flags = check_output(['mpicc', "--showme:compile"]).decode("utf-8") + link_flags = check_output(['mpicc', "--showme:link"]).decode("utf-8") + else: + # TODO: This can be obtained from MPICH `mpicc -show` + # but does not segregate compile and link flags raise NotImplementedError("Unable to detect MPI compile and link flags") - # OpenMPI's CC wrapper, namely mpicc, takes the --showme argument to find out - # the flags used for compiling and linking - compile_flags = check_output(['mpicc', "--showme:compile"]).decode("utf-8") - link_flags = check_output(['mpicc', "--showme:link"]).decode("utf-8") - return compile_flags.split(), link_flags.split()