diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/spectrum-mpi/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/spectrum-mpi/package.py | 126 |
1 files changed, 59 insertions, 67 deletions
diff --git a/var/spack/repos/builtin/packages/spectrum-mpi/package.py b/var/spack/repos/builtin/packages/spectrum-mpi/package.py index 651f87a262..2f38e50f02 100644 --- a/var/spack/repos/builtin/packages/spectrum-mpi/package.py +++ b/var/spack/repos/builtin/packages/spectrum-mpi/package.py @@ -16,16 +16,16 @@ class SpectrumMpi(BundlePackage): homepage = "https://www-03.ibm.com/systems/spectrum-computing/products/mpi" # https://www.ibm.com/docs/en/smpi/10.4 - version('10.4') + version("10.4") - provides('mpi') + provides("mpi") - executables = ['^ompi_info$'] + executables = ["^ompi_info$"] @classmethod def determine_version(cls, exe): output = Executable(exe)(output=str, error=str) - match = re.search(r'Spectrum MPI: (\S+)', output) + match = re.search(r"Spectrum MPI: (\S+)", output) if not match: return None version = match.group(1) @@ -34,27 +34,19 @@ class SpectrumMpi(BundlePackage): @classmethod def determine_variants(cls, exes, version): compiler_suites = { - 'xl': {'cc': 'mpixlc', - 'cxx': 'mpixlC', - 'f77': 'mpixlf', - 'fc': 'mpixlf'}, - 'pgi': {'cc': 'mpipgicc', - 'cxx': 'mpipgic++', - 'f77': 'mpipgifort', - 'fc': 'mpipgifort'}, - 'default': {'cc': 'mpicc', - 'cxx': 'mpicxx', - 'f77': 'mpif77', - 'fc': 'mpif90'}} + "xl": {"cc": "mpixlc", "cxx": "mpixlC", "f77": "mpixlf", "fc": "mpixlf"}, + "pgi": {"cc": "mpipgicc", "cxx": "mpipgic++", "f77": "mpipgifort", "fc": "mpipgifort"}, + "default": {"cc": "mpicc", "cxx": "mpicxx", "f77": "mpif77", "fc": "mpif90"}, + } def get_host_compiler(exe): output = Executable(exe)("--showme", output=str, error=str) - match = re.search(r'^(\S+)', output) + match = re.search(r"^(\S+)", output) return match.group(1) if match else None def get_spack_compiler_spec(compilers_found): # check using cc for now, as everyone should have that defined. - path = os.path.dirname(compilers_found['cc']) + path = os.path.dirname(compilers_found["cc"]) spack_compilers = spack.compilers.find_compilers([path]) actual_compiler = None # check if the compiler actually matches the one we want @@ -84,7 +76,7 @@ class SpectrumMpi(BundlePackage): if compiler_spec: variant = "%" + str(compiler_spec) else: - variant = '' + variant = "" # Use this variant when you need to define the # compilers explicitly # @@ -93,66 +85,66 @@ class SpectrumMpi(BundlePackage): # Otherwise, use this simpler attribute results.append(variant) else: - results.append('') + results.append("") return results def setup_dependent_package(self, module, dependent_spec): # get the compiler names - if '%xl' in dependent_spec or '%xl_r' in dependent_spec: - self.spec.mpicc = os.path.join(self.prefix.bin, 'mpixlc') - self.spec.mpicxx = os.path.join(self.prefix.bin, 'mpixlC') - self.spec.mpif77 = os.path.join(self.prefix.bin, 'mpixlf') - self.spec.mpifc = os.path.join(self.prefix.bin, 'mpixlf') - elif '%pgi' in dependent_spec: - self.spec.mpicc = os.path.join(self.prefix.bin, 'mpipgicc') - self.spec.mpicxx = os.path.join(self.prefix.bin, 'mpipgic++') - self.spec.mpif77 = os.path.join(self.prefix.bin, 'mpipgifort') - self.spec.mpifc = os.path.join(self.prefix.bin, 'mpipgifort') + if "%xl" in dependent_spec or "%xl_r" in dependent_spec: + self.spec.mpicc = os.path.join(self.prefix.bin, "mpixlc") + self.spec.mpicxx = os.path.join(self.prefix.bin, "mpixlC") + self.spec.mpif77 = os.path.join(self.prefix.bin, "mpixlf") + self.spec.mpifc = os.path.join(self.prefix.bin, "mpixlf") + elif "%pgi" in dependent_spec: + self.spec.mpicc = os.path.join(self.prefix.bin, "mpipgicc") + self.spec.mpicxx = os.path.join(self.prefix.bin, "mpipgic++") + self.spec.mpif77 = os.path.join(self.prefix.bin, "mpipgifort") + self.spec.mpifc = os.path.join(self.prefix.bin, "mpipgifort") else: - self.spec.mpicc = os.path.join(self.prefix.bin, 'mpicc') - self.spec.mpicxx = os.path.join(self.prefix.bin, 'mpicxx') - self.spec.mpif77 = os.path.join(self.prefix.bin, 'mpif77') - self.spec.mpifc = os.path.join(self.prefix.bin, 'mpif90') + self.spec.mpicc = os.path.join(self.prefix.bin, "mpicc") + self.spec.mpicxx = os.path.join(self.prefix.bin, "mpicxx") + self.spec.mpif77 = os.path.join(self.prefix.bin, "mpif77") + self.spec.mpifc = os.path.join(self.prefix.bin, "mpif90") def setup_dependent_build_environment(self, env, dependent_spec): - if '%xl' in dependent_spec or '%xl_r' in dependent_spec: - env.set('MPICC', os.path.join(self.prefix.bin, 'mpixlc')) - env.set('MPICXX', os.path.join(self.prefix.bin, 'mpixlC')) - env.set('MPIF77', os.path.join(self.prefix.bin, 'mpixlf')) - env.set('MPIF90', os.path.join(self.prefix.bin, 'mpixlf')) - elif '%pgi' in dependent_spec: - env.set('MPICC', os.path.join(self.prefix.bin, 'mpipgicc')) - env.set('MPICXX', os.path.join(self.prefix.bin, 'mpipgic++')) - env.set('MPIF77', os.path.join(self.prefix.bin, 'mpipgifort')) - env.set('MPIF90', os.path.join(self.prefix.bin, 'mpipgifort')) + if "%xl" in dependent_spec or "%xl_r" in dependent_spec: + env.set("MPICC", os.path.join(self.prefix.bin, "mpixlc")) + env.set("MPICXX", os.path.join(self.prefix.bin, "mpixlC")) + env.set("MPIF77", os.path.join(self.prefix.bin, "mpixlf")) + env.set("MPIF90", os.path.join(self.prefix.bin, "mpixlf")) + elif "%pgi" in dependent_spec: + env.set("MPICC", os.path.join(self.prefix.bin, "mpipgicc")) + env.set("MPICXX", os.path.join(self.prefix.bin, "mpipgic++")) + env.set("MPIF77", os.path.join(self.prefix.bin, "mpipgifort")) + env.set("MPIF90", os.path.join(self.prefix.bin, "mpipgifort")) else: - env.set('MPICC', os.path.join(self.prefix.bin, 'mpicc')) - env.set('MPICXX', os.path.join(self.prefix.bin, 'mpic++')) - env.set('MPIF77', os.path.join(self.prefix.bin, 'mpif77')) - env.set('MPIF90', os.path.join(self.prefix.bin, 'mpif90')) + env.set("MPICC", os.path.join(self.prefix.bin, "mpicc")) + env.set("MPICXX", os.path.join(self.prefix.bin, "mpic++")) + env.set("MPIF77", os.path.join(self.prefix.bin, "mpif77")) + env.set("MPIF90", os.path.join(self.prefix.bin, "mpif90")) - env.set('OMPI_CC', spack_cc) - env.set('OMPI_CXX', spack_cxx) - env.set('OMPI_FC', spack_fc) - env.set('OMPI_F77', spack_f77) + env.set("OMPI_CC", spack_cc) + env.set("OMPI_CXX", spack_cxx) + env.set("OMPI_FC", spack_fc) + env.set("OMPI_F77", spack_f77) - env.prepend_path('LD_LIBRARY_PATH', self.prefix.lib) + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) def setup_run_environment(self, env): # Because MPI functions as a compiler we need to setup the compilers # in the run environment, like any compiler - if '%xl' in self.spec or '%xl_r' in self.spec: - env.set('MPICC', os.path.join(self.prefix.bin, 'mpixlc')) - env.set('MPICXX', os.path.join(self.prefix.bin, 'mpixlC')) - env.set('MPIF77', os.path.join(self.prefix.bin, 'mpixlf')) - env.set('MPIF90', os.path.join(self.prefix.bin, 'mpixlf')) - elif '%pgi' in self.spec: - env.set('MPICC', os.path.join(self.prefix.bin, 'mpipgicc')) - env.set('MPICXX', os.path.join(self.prefix.bin, 'mpipgic++')) - env.set('MPIF77', os.path.join(self.prefix.bin, 'mpipgifort')) - env.set('MPIF90', os.path.join(self.prefix.bin, 'mpipgifort')) + if "%xl" in self.spec or "%xl_r" in self.spec: + env.set("MPICC", os.path.join(self.prefix.bin, "mpixlc")) + env.set("MPICXX", os.path.join(self.prefix.bin, "mpixlC")) + env.set("MPIF77", os.path.join(self.prefix.bin, "mpixlf")) + env.set("MPIF90", os.path.join(self.prefix.bin, "mpixlf")) + elif "%pgi" in self.spec: + env.set("MPICC", os.path.join(self.prefix.bin, "mpipgicc")) + env.set("MPICXX", os.path.join(self.prefix.bin, "mpipgic++")) + env.set("MPIF77", os.path.join(self.prefix.bin, "mpipgifort")) + env.set("MPIF90", os.path.join(self.prefix.bin, "mpipgifort")) else: - env.set('MPICC', os.path.join(self.prefix.bin, 'mpicc')) - env.set('MPICXX', os.path.join(self.prefix.bin, 'mpic++')) - env.set('MPIF77', os.path.join(self.prefix.bin, 'mpif77')) - env.set('MPIF90', os.path.join(self.prefix.bin, 'mpif90')) + env.set("MPICC", os.path.join(self.prefix.bin, "mpicc")) + env.set("MPICXX", os.path.join(self.prefix.bin, "mpic++")) + env.set("MPIF77", os.path.join(self.prefix.bin, "mpif77")) + env.set("MPIF90", os.path.join(self.prefix.bin, "mpif90")) |