@@ -116,6 +116,8 @@ def sniff_mpi_distro(mpiexec):
116116 return 'MPICH'
117117 elif "Intel(R) MPI" in ver :
118118 return 'IntelMPI'
119+ elif "IBM Spectrum MPI" in ver :
120+ return "SpectrumMPI"
119121 except (CalledProcessError , UnicodeDecodeError ):
120122 pass
121123 return 'unknown'
@@ -124,14 +126,16 @@ def sniff_mpi_distro(mpiexec):
124126@memoized_func
125127def sniff_mpi_flags (mpicc = 'mpicc' ):
126128 mpi_distro = sniff_mpi_distro ('mpiexec' )
127- if mpi_distro != 'OpenMPI' :
129+ if mpi_distro in ['OpenMPI' , 'SpectrumMPI' ]:
130+ # OpenMPI's CC wrapper, namely mpicc, takes the --showme argument to find out
131+ # the flags used for compiling and linking
132+ compile_flags = check_output (['mpicc' , "--showme:compile" ]).decode ("utf-8" )
133+ link_flags = check_output (['mpicc' , "--showme:link" ]).decode ("utf-8" )
134+ else :
135+ # TODO: This can be obtained from MPICH `mpicc -show`
136+ # but does not segregate compile and link flags
128137 raise NotImplementedError ("Unable to detect MPI compile and link flags" )
129138
130- # OpenMPI's CC wrapper, namely mpicc, takes the --showme argument to find out
131- # the flags used for compiling and linking
132- compile_flags = check_output (['mpicc' , "--showme:compile" ]).decode ("utf-8" )
133- link_flags = check_output (['mpicc' , "--showme:link" ]).decode ("utf-8" )
134-
135139 return compile_flags .split (), link_flags .split ()
136140
137141
0 commit comments