-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
482 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
sudo=$(command -v sudo || true) | ||
|
||
if grep -qE 'ID=(debian|ubuntu)' /etc/os-release; then | ||
packages=( | ||
python3-venv | ||
pypy3 | ||
libmpich12 | ||
libopenmpi3 | ||
) | ||
export DEBIAN_FRONTEND=noninteractive | ||
$sudo apt update -y | ||
$sudo apt install -y ${packages[@]} | ||
multiarch=$(arch | sed s/^ppc/powerpc/)-linux-gnu | ||
$sudo ln -sr /usr/lib/$multiarch/libmpi{ch,}.so.12 | ||
fi | ||
|
||
if grep -qE 'ID=fedora' /etc/os-release; then | ||
packages=( | ||
python3.6 | ||
python3.7 | ||
python3.8 | ||
python3.9 | ||
python3.10 | ||
python3.11 | ||
python3.12 | ||
pypy3.9 | ||
pypy3.10 | ||
mpich | ||
openmpi | ||
) | ||
opts=--setopt=install_weak_deps=False | ||
$sudo dnf install -y $opts ${packages[@]} | ||
set +u | ||
source /etc/profile.d/modules.sh | ||
set -u | ||
fi | ||
|
||
sdir=$(cd "$(dirname -- "$0")" && pwd -P) | ||
$sdir/test-basic.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
sdir=$(cd "$(dirname -- "$0")" && pwd -P) | ||
$sdir/test-basic.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
wheelhouse="${1:-dist}" | ||
|
||
PYTHON=( | ||
"${python36-python3.6}" | ||
"${python37-python3.7}" | ||
"${python38-python3.8}" | ||
"${python39-python3.9}" | ||
"${python310-python3.10}" | ||
"${python311-python3.11}" | ||
"${python312-python3.12}" | ||
"${pypy37-pypy3.7}" | ||
"${pypy38-pypy3.8}" | ||
"${pypy39-pypy3.9}" | ||
"${pypy310-pypy3.10}" | ||
) | ||
|
||
if [[ $(uname) =~ NT ]]; then | ||
MPI=(impi msmpi) | ||
bin="Scripts" | ||
exe=".exe" | ||
else | ||
MPI=(mpich openmpi) | ||
bin="bin" | ||
exe="" | ||
fi | ||
|
||
venvroot=$(mktemp -d) | ||
trap "rm -rf $venvroot" EXIT | ||
export PIP_QUIET=1 | ||
|
||
function setup-python { | ||
venvdir=$(mktemp -d -p "$venvroot" XXX) | ||
"$python" -m venv "$venvdir" | ||
python="$venvdir/$bin/python$exe" | ||
"$python" --version | ||
"$python" -m pip install pip --upgrade | ||
} | ||
|
||
function setup-mpi4py { | ||
"$python" -m pip install mpi4py --no-index --find-links="$wheelhouse" | ||
test $? -ne 0 && return 1 | ||
"$python" -m mpi4py --version | ||
} | ||
|
||
function setup-mpi { | ||
local mpi=$1 | ||
if command -v brew > /dev/null; then | ||
brew unlink mpich openmpi > /dev/null | ||
brew link $mpi > /dev/null | ||
elif command -v module > /dev/null; then | ||
module switch mpi/$mpi-$(arch) | ||
elif test $(uname) == Linux; then | ||
local version=$(test $mpi == openmpi && echo 40 || echo 12) | ||
export MPI4PY_LIBMPI=libmpi.so.$version | ||
else | ||
export MPI4PY_MPIABI=$mpi | ||
fi | ||
} | ||
|
||
function clean-mpi { | ||
local mpi=$1 | ||
if command -v brew > /dev/null; then | ||
brew unlink $mpi > /dev/null | ||
elif command -v module > /dev/null; then | ||
module unload mpi/$mpi-$(arch) | ||
fi | ||
unset MPI4PY_LIBMPI | ||
unset MPI4PY_MPIABI | ||
} | ||
|
||
function mpi4py-test-basic { | ||
"$python" -m mpi4py --mpi-std-version | ||
"$python" -m mpi4py --mpi-lib-version | head -n 1 | ||
} | ||
|
||
for python in ${PYTHON[@]}; do | ||
test -z $(command -v "$python") && continue | ||
pyversion=$("$python" -c "import sys; print(sys.version.split()[0])") | ||
pyimpname=$("$python" -c "import sys; print(sys.implementation.name)") | ||
echo "::group::Python $pyversion [$pyimpname]" | ||
setup-python | ||
setup-mpi4py || continue | ||
for mpi in ${MPI[@]}; do | ||
echo "* Use MPI=$mpi" | ||
setup-mpi $mpi | ||
if [ $mpi == $mpi ]; then | ||
echo "- Test MPIABI discovery" | ||
mpi4py-test-basic | ||
fi | ||
if [ $mpi == mpich -o $mpi == openmpi ]; then | ||
export MPI4PY_MPIABI=mpi31-$mpi | ||
echo "- Test MPIABI=$MPI4PY_MPIABI" | ||
mpi4py-test-basic | ||
fi | ||
clean-mpi $mpi | ||
echo "" | ||
done | ||
echo "::endgroup::" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
images=( | ||
debian:10 | ||
debian:11 | ||
debian:12 | ||
ubuntu:20.04 | ||
ubuntu:22.04 | ||
ubuntu:23.10 | ||
fedora:37 | ||
fedora:38 | ||
) | ||
arches=( | ||
x86_64 | ||
#aarch64 | ||
#ppc64le | ||
) | ||
sdir=$(cd "$(dirname -- "$0")" && pwd -P) | ||
|
||
for image in ${images[@]}; do | ||
for arch in ${arches[@]}; do | ||
ls dist | grep -q $arch || continue | ||
echo Running on $image $arch | ||
docker run \ | ||
--rm \ | ||
-v $(pwd):$(pwd):z \ | ||
-w $(pwd) \ | ||
--arch $arch \ | ||
$image \ | ||
bash $sdir/test-Linux.sh | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
packages_py=( | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
pypy3.9 | ||
pypy3.10 | ||
) | ||
packages_mpi=( | ||
mpich | ||
openmpi | ||
) | ||
brew install ${packages_py[@]} | ||
for mpi in ${packages_mpi[@]}; do | ||
brew unlink $mpi || true | ||
done | ||
for mpi in ${packages_mpi[@]}; do | ||
brew install $mpi | ||
brew unlink $mpi | ||
done | ||
|
||
sdir=$(cd "$(dirname -- "$0")" && pwd -P) | ||
$sdir/test-basic.sh |
Oops, something went wrong.