Skip to content

Commit

Permalink
Merge branch 'jcsda_emc_spack_stack' of https://github.com/NOAA-EMC/s…
Browse files Browse the repository at this point in the history
…pack into feature/update_jcsda_emc_spack_stack_from_authoritative_20220404
  • Loading branch information
climbfuji committed Apr 7, 2022
2 parents 70ab1f0 + fb489ae commit df43156
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions var/spack/repos/builtin/packages/openmpi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def determine_version(cls, exe):
def determine_variants(cls, exes, version):
results = []
for exe in exes:
variants = ''
variants = []
output = Executable(exe)("-a", output=str, error=str)
# Some of these options we have to find by hoping the
# configure string is in the ompi_info output. While this
Expand All @@ -384,72 +384,72 @@ def determine_variants(cls, exes, version):
# by the openmpi package in the absense of any other info.

if re.search(r'--enable-builtin-atomics', output):
variants += "+atomics"
variants.append("+atomics")
match = re.search(r'\bJava bindings: (\S+)', output)
if match and is_enabled(match.group(1)):
variants += "+java"
variants.append("+java")
else:
variants += "~java"
variants.append("~java")
if re.search(r'--enable-static', output):
variants += "+static"
variants.append("+static")
elif re.search(r'--disable-static', output):
variants += "~static"
variants.append("~static")
elif re.search(r'\bMCA (?:coll|oca|pml): monitoring',
output):
# Built multiple variants of openmpi and ran diff.
# This seems to be the distinguishing feature.
variants += "~static"
variants.append("~static")
if re.search(r'\bMCA db: sqlite', output):
variants += "+sqlite3"
variants.append("+sqlite3")
else:
variants += "~sqlite3"
variants.append("~sqlite3")
if re.search(r'--enable-contrib-no-build=vt', output):
variants += '+vt'
variants.append('+vt')
match = re.search(r'MPI_THREAD_MULTIPLE: (\S+?),?', output)
if match and is_enabled(match.group(1)):
variants += '+thread_multiple'
variants.append('+thread_multiple')
else:
variants += '~thread_multiple'
variants.append('~thread_multiple')
match = re.search(
r'parameter "mpi_built_with_cuda_support" ' +
r'\(current value: "(\S+)"',
output)
if match and is_enabled(match.group(1)):
variants += '+cuda'
variants.append('+cuda')
else:
variants += '~cuda'
variants.append('~cuda')
match = re.search(r'\bWrapper compiler rpath: (\S+)', output)
if match and is_enabled(match.group(1)):
variants += '+wrapper-rpath'
variants.append('+wrapper-rpath')
else:
variants += '~wrapper-rpath'
variants.append('~wrapper-rpath')
match = re.search(r'\bC\+\+ bindings: (\S+)', output)
if match and match.group(1) == 'yes':
variants += '+cxx'
variants.append('+cxx')
else:
variants += '~cxx'
variants.append('~cxx')
match = re.search(r'\bC\+\+ exceptions: (\S+)', output)
if match and match.group(1) == 'yes':
variants += '+cxx_exceptions'
variants.append('+cxx_exceptions')
else:
variants += '~cxx_exceptions'
variants.append('~cxx_exceptions')
if re.search(r'--with-singularity', output):
variants += '+singularity'
variants.append('+singularity')
if re.search(r'--with-lustre', output):
variants += '+lustre'
variants.append('+lustre')
match = re.search(r'Memory debugging support: (\S+)', output)
if match and is_enabled(match.group(1)):
variants += '+memchecker'
variants.append('+memchecker')
else:
variants += '~memchecker'
variants.append('~memchecker')
if re.search(r'\bMCA (?:ess|prrte): pmi', output):
variants += '+pmi'
variants.append('+pmi')
else:
variants += '~pmi'
variants.append('~pmi')
if re.search(r'\bMCA pmix', output):
variants += '+pmix'
variants.append('+pmix')
else:
variants += '~pmix'
variants.append('~pmix')

fabrics = get_options_from_variant(cls, "fabrics")
used_fabrics = []
Expand All @@ -459,7 +459,7 @@ def determine_variants(cls, exes, version):
if match:
used_fabrics.append(fabric)
if used_fabrics:
variants += ' fabrics=' + ','.join(used_fabrics) + ' '
variants.append('fabrics=' + ','.join(used_fabrics))

schedulers = get_options_from_variant(cls, "schedulers")
used_schedulers = []
Expand All @@ -469,16 +469,16 @@ def determine_variants(cls, exes, version):
if match:
used_schedulers.append(scheduler)
if used_schedulers:
variants += ' schedulers=' + ','.join(used_schedulers) + ' '
variants.append('schedulers=' + ','.join(used_schedulers))

# Get the appropriate compiler
match = re.search(r'\bC compiler absolute: (\S+)', output)
if match:
compiler_spec = get_spack_compiler_spec(
os.path.dirname(match.group(1)))
if compiler_spec:
variants += "%" + str(compiler_spec)
results.append(variants)
variants.append("%" + str(compiler_spec))
results.append(' '.join(variants))
return results

def url_for_version(self, version):
Expand Down Expand Up @@ -1051,7 +1051,8 @@ def get_spack_compiler_spec(path):
actual_compiler = None
# check if the compiler actually matches the one we want
for spack_compiler in spack_compilers:
if os.path.dirname(spack_compiler.cc) == path:
if (spack_compiler.cc and
os.path.dirname(spack_compiler.cc) == path):
actual_compiler = spack_compiler
break
return actual_compiler.spec if actual_compiler else None
Expand Down

0 comments on commit df43156

Please sign in to comment.