Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to openmpi on macOS, update spack (merge spack authoritative updates as of 2022/04/04) #112

Merged
merged 28 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9a60e64
Switch to openmpi on macOS
climbfuji Apr 4, 2022
98b902f
Merge branch 'develop' of https://github.com/noaa-emc/spack-stack int…
climbfuji Apr 4, 2022
4ced3de
Update .gitmodules and submodule pointer for spack for testing
climbfuji Apr 4, 2022
9c9b026
Use openmpi for macos-llvm-clang and macos-apple-clang github workflows
climbfuji Apr 4, 2022
0928896
Merge branch 'develop' of https://github.com/noaa-emc/spack-stack int…
climbfuji Apr 7, 2022
7ca1c75
Remove version identified from clang compiler in .github/workflows/ma…
climbfuji Apr 7, 2022
352ea6d
Bug fix in .github/actions/setup-spack-stack/action.yaml
climbfuji Apr 7, 2022
72a628e
Update spack submodule
climbfuji Apr 7, 2022
b9003ff
Update spack submodule
climbfuji Apr 7, 2022
6abc298
Merge branch 'develop' of https://github.com/noaa-emc/spack-stack int…
climbfuji Apr 7, 2022
0b5c687
Use internal hwloc/libevent when building openmpi
climbfuji Apr 8, 2022
fe28a8d
For debugging
climbfuji Apr 8, 2022
4afe505
Bump mpi cache version number
climbfuji Apr 8, 2022
0cfd9ae
Merge branch 'develop' of https://github.com/noaa-emc/spack-stack int…
climbfuji Apr 8, 2022
5aa05d3
Temporarily change mpi version numbers for testing
climbfuji Apr 8, 2022
21ce595
Next attempt to find MPI
climbfuji Apr 8, 2022
0816473
Try to find git-lfs explicitly
climbfuji Apr 8, 2022
4778358
Use git external find --all for CI tests
climbfuji Apr 11, 2022
ab3eb5e
Change all of jedi-cmake from JCSDA-internal to JCSDA
climbfuji Apr 11, 2022
92aee3f
Update submodule pointer for spack
climbfuji Apr 11, 2022
9ffdfb5
Remove all download artifacts that contain a '?'
climbfuji Apr 11, 2022
c3c0cca
Update submodule pointer for spack
climbfuji Apr 11, 2022
62114e9
Temporary commit for Intel in .github/actions/setup-spack-stack/actio…
climbfuji Apr 11, 2022
daaef9b
Use py-scipy 1.7.3 on macOS with gcc
climbfuji Apr 11, 2022
8359491
Update submodule pointer for spack
climbfuji Apr 11, 2022
3edb222
Update submodule pointer for spack
climbfuji Apr 12, 2022
4e908dc
Remove unnecessary pinning of py-scipy version 1.7.3 in .github/actio…
climbfuji Apr 12, 2022
1aaaf98
Revert .gitmodules and update submodules pointer for spack
climbfuji Apr 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 40 additions & 21 deletions .github/actions/setup-spack-stack/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ runs:
- name: os-setup
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
if [[ "$RUNNER_OS" == "Linux" ]]; then
# Install Curl headers. Executable exists by default in spack external find.
sudo apt-get install libcurl4-openssl-dev

# Install git-lfs to avoid compilation errors of "go" with Intel
sudo apt-get install git-lfs

if [[ "${{ inputs.compiler }}" == "intel"* ]]; then
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Expand All @@ -47,8 +50,8 @@ runs:
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-openmp intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mpi-devel
echo "source /opt/intel/oneapi/setvars.sh" >> ~/.bash_profile
fi
elif [ "$RUNNER_OS" == "macOS" ]; then
echo ""
elif [[ "$RUNNER_OS" == "macOS" ]]; then
echo " "
fi

# Install Python poetry to avoid install errors in spack
Expand Down Expand Up @@ -94,9 +97,10 @@ runs:

if [[ "${{ inputs.mpi }}" == "openmpi"* ]]; then
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-${OPENMPI_VERSION}.tar.gz
tar -xzf openmpi-${OPENMP_VERSION}.tar.gz
cd openmpi-${OPENMP_VERSION}
./configure --prefix=$HOME/mpi --enable-mpi-fortran --enable-mpi-cxx
tar -xzf openmpi-${OPENMPI_VERSION}.tar.gz
cd openmpi-${OPENMPI_VERSION}
# --with-hwloc=internal --with-libevent=internal : https://www.open-mpi.org/faq/?category=building#libevent-or-hwloc-errors-when-linking-fortran
./configure --prefix=$HOME/mpi --enable-mpi-fortran --enable-mpi-cxx --with-hwloc=internal --with-libevent=internal
make -j2
make install
elif [[ "${{ inputs.mpi }}" == "mpich"* ]]; then
Expand All @@ -122,6 +126,8 @@ runs:

# So Spack can find external MPI
export "PATH=$HOME/mpi/bin:${PATH}"
export MPICH_VERSION="3.4.3"
export OPENMPI_VERSION="4.1.3"

# LLVM Clang not in PATH, search for it specifically
# Then, Fortran compilers are null, so set to gfortran
Expand All @@ -132,11 +138,13 @@ runs:
sed -i".bak" "s|fc: null|fc: /usr/local/bin/gfortran-10|" ${SPACK_ENV}/spack.yaml
elif [[ "${{ inputs.compiler }}" == "intel"* ]]; then
spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
# Workaround for error "libimf.so cannot be found":
sed -i 's#environment: {}#environment: {prepend_path: {LD_LIBRARY_PATH: /opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin}}#g' envs/${{ inputs.app }}/spack.yaml
else
spack compiler find
fi

# No external find for intel-oneapi-mpi
# No external find for intel-oneapi-mpi, and problems finding other MPI libraries as well
# And no way to add object entry to list using "spack config add"
# Add this first so "spack config add packages:" will append to this entry
if [[ "${{ inputs.mpi }}" == "intel-oneapi-mpi" ]]; then
Expand All @@ -148,9 +156,32 @@ runs:
echo " externals:" >> ${SPACK_ENV}/spack.yaml
echo " - spec: intel-oneapi-mpi@${impi_ver}" >> ${SPACK_ENV}/spack.yaml
echo " prefix: /opt/intel/oneapi" >> ${SPACK_ENV}/spack.yaml
elif [[ "${{ inputs.mpi }}" == "mpich"* ]]; then
mpich_ver=${MPICH_VERSION}
echo "" >> ${SPACK_ENV}/spack.yaml
echo " packages:" >> ${SPACK_ENV}/spack.yaml
echo " mpich:" >> ${SPACK_ENV}/spack.yaml
echo " buildable: False" >> ${SPACK_ENV}/spack.yaml
echo " externals:" >> ${SPACK_ENV}/spack.yaml
echo " - spec: mpich@${mpich_ver}" >> ${SPACK_ENV}/spack.yaml
echo " prefix: $HOME/mpi" >> ${SPACK_ENV}/spack.yaml
elif [[ "${{ inputs.mpi }}" == "openmpi"* ]]; then
openmpi_ver=${OPENMPI_VERSION}
echo "" >> ${SPACK_ENV}/spack.yaml
echo " packages:" >> ${SPACK_ENV}/spack.yaml
echo " openmpi:" >> ${SPACK_ENV}/spack.yaml
echo " buildable: False" >> ${SPACK_ENV}/spack.yaml
echo " externals:" >> ${SPACK_ENV}/spack.yaml
echo " - spec: openmpi@${openmpi_ver}" >> ${SPACK_ENV}/spack.yaml
echo " prefix: $HOME/mpi" >> ${SPACK_ENV}/spack.yaml
Comment on lines +159 to +176
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the option of externally finding it, I would search for OpenMPI and MPICH instead of this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Now that I am using spack external find --all, it should be able to find it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try this in the next set of PRs.

fi

spack external find
# Spack external find is by default only looking for build-tools. Either
# search for additional packages explicitly, or fall back to the old
# behavior to find all external packages.
#spack external find
#spack external find git-lfs openmpi mpich
spack external find --all

- name: update-bash-profile
shell: bash
Expand Down Expand Up @@ -185,12 +216,6 @@ runs:
spack config add "modules:default:tcl:whitelist:[${{ inputs.mpi }}]"
spack config add "modules:default:lmod:whitelist:[${{ inputs.mpi }}]"

# Currently, this is the case for all workflows - wrap in if statement
# when this changes in the future
# Whitelist the mpi providers so that spack creates the modules for them
spack config add "modules:default:tcl:whitelist:[${{ inputs.mpi }}]"
spack config add "modules:default:lmod:whitelist:[${{ inputs.mpi }}]"

if [[ "$RUNNER_OS" == "Linux" ]]; then
echo ""
elif [[ "$RUNNER_OS" == "macOS" ]]; then
Expand All @@ -214,13 +239,7 @@ runs:
cd ${{ inputs.path }}
source setup.sh
spack env activate ${{ inputs.path }}/envs/${{ inputs.app }}
if [[ "${{ inputs.compiler }}" == "intel"* ]]; then
source /opt/intel/oneapi/setvars.sh
# Pass --dirty for Intel compiler environment to fix missing LD_LIBRARY_PATH
spack install --dirty --fail-fast
else
spack install --fail-fast
fi
spack install --fail-fast

- name: create-meta-modules
shell: bash
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/create-spack-mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
spack add clingo
spack concretize
spack mirror create -a
# upload-artifact does not allow filenames that begin with '?'
rm -f cache/source_cache/autoconf/\?id=05972f49ee632cd98057a3caf82ebfb9574846da-eaa3f69
rm -f cache/source_cache/boost/attachment.cgi?id=356970-b6f6ce6
rm -f cache/source_cache/py-scipy/extern_decls.patch?id=711fe05025795e44b84233e065d240859ccae5bd-5433f60
# upload-artifact does not allow filenames that contain '?'
rm -vf `find cache/source_cache -name '*\?*'`
Comment on lines +36 to +37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better


- name: upload-mirror
uses: actions/upload-artifact@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos-apple-clang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
uses: ./.github/actions/setup-spack-stack
with:
app: ${{ matrix.app }}
compiler: apple-clang@13
mpi: mpich
compiler: apple-clang
mpi: openmpi
path: ${{ github.workspace }}
2 changes: 1 addition & 1 deletion .github/workflows/macos-llvm-clang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
with:
app: ${{ matrix.app }}
compiler: clang
mpi: mpich
mpi: openmpi
path: ${{ github.workspace }}
4 changes: 2 additions & 2 deletions configs/common/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
esmf:
version: [8.2.0]
variants: ~xerces ~pnetcdf
# Attention - when updating also check macos-monterey-llvm-clang-mpich-reference site config
# Attention - when updating also check macos-monterey-llvm-clang-openmpi-reference site config
fms:
version: [2022.01]
variants: +64bit +enable_quad_precision +gfs_phys +openmp +pic
# Attention - when updating also check macos-monterey-llvm-clang-mpich-reference site config
# Attention - when updating also check macos-monterey-llvm-clang-openmpi-reference site config
fms-jcsda:
version: [release-stable]
variants: +64bit +enable_quad_precision +gfs_phys +openmp +pic
Expand Down
4 changes: 2 additions & 2 deletions configs/repos/jedi/packages/jedi-cmake/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class JediCmake(CMakePackage):
"""CMake/ecbuild toolchains to facilitate portability on different systems."""

homepage = "https://github.com/JCSDA-internal/jedi-cmake"
git = "https://github.com/JCSDA-internal/jedi-cmake.git"
homepage = "https://github.com/JCSDA/jedi-cmake"
git = "https://github.com/JCSDA/jedi-cmake.git"
url = "https://github.com/JCSDA/jedi-cmake/archive/refs/tags/1.3.0.tar.gz"

maintainers = ['climbfuji', 'rhoneyager']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This step is only required on the new arch64 systems that are equipped with a Ap
brew install [email protected]
brew install [email protected]
brew install llvm13.0.0
brew install [email protected]
brew install [email protected]
brew install [email protected]
brew install [email protected]
brew install [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packages:
all:
compiler:: [[email protected]]
providers:
mpi:: [[email protected]]
mpi:: [[email protected]]

### MPI, Python, MKL
mpi:
Expand Down
2 changes: 1 addition & 1 deletion spack
Submodule spack updated from fb489a to e02d34