Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
750f252
first test version
boeschf Mar 21, 2024
ee103f6
indentation
boeschf Mar 21, 2024
3494d66
trial with cache
boeschf Mar 21, 2024
46bdc66
remove cancel condition
boeschf Mar 21, 2024
cb4db1d
remove cancel condition
boeschf Mar 21, 2024
87c2b0f
branch name
boeschf Mar 21, 2024
977ceb5
use default build cache
boeschf Mar 21, 2024
f7169f5
require gcc
boeschf Mar 21, 2024
a4c00ac
local cache test
boeschf Mar 21, 2024
8f0f3c0
new trial
boeschf Mar 21, 2024
c8d71a0
local cache test
boeschf Mar 21, 2024
8ccf7e4
print actor
boeschf Mar 21, 2024
bdabd8b
dump context
boeschf Mar 22, 2024
d298885
owner
boeschf Mar 22, 2024
8b66ded
prevent error?
boeschf Mar 22, 2024
9f0b342
early login
boeschf Mar 22, 2024
b042679
public package
boeschf Mar 22, 2024
2a857ef
owner
boeschf Mar 22, 2024
12adc6b
more compiling
boeschf Mar 22, 2024
0b4ff54
actually building ghex
boeschf Mar 22, 2024
f0ff22d
one more
boeschf Mar 22, 2024
14b6233
with test
boeschf Mar 22, 2024
8fc461e
inspect
boeschf Mar 22, 2024
ffc3ad3
more inspect
boeschf Mar 22, 2024
ed784f8
try with system packages
boeschf Mar 25, 2024
63105cc
remove versions for requirements-test
boeschf Mar 25, 2024
b9e388a
print python env variables
boeschf Mar 25, 2024
47d5eb4
print python env variables
boeschf Mar 25, 2024
f5e295e
venv troubles
boeschf Mar 25, 2024
7f2a47b
venv troubles
boeschf Mar 25, 2024
fc2fed6
venv troubles
boeschf Mar 25, 2024
a04dc9c
use binary from venv
boeschf Mar 25, 2024
e596438
remove inspection
boeschf Mar 25, 2024
0f39873
cleanup
boeschf Mar 25, 2024
78acf76
remove debug printing
boeschf Mar 25, 2024
c4630dc
different backends
boeschf Mar 25, 2024
c57e9bd
different backends
boeschf Mar 25, 2024
8c08118
typo
boeschf Mar 25, 2024
d20ed2b
print logs on failure
boeschf Mar 25, 2024
6552a05
backend
boeschf Mar 25, 2024
a7e3911
+cuda+mpi
boeschf Mar 25, 2024
a66d4b4
print stuff
boeschf Mar 25, 2024
840182b
cleanup
boeschf Mar 26, 2024
aab35f8
readme
boeschf Mar 26, 2024
bd7a11d
typos
boeschf Mar 26, 2024
de3ff3f
Merge remote-tracking branch 'upstream/master' into ci/spack
boeschf Apr 23, 2024
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
127 changes: 127 additions & 0 deletions .github/workflows/test_spack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Test spack

on:
push:
pull_request:
branches:
- master

jobs:
test-spack:
runs-on: ubuntu-22.04

permissions:
packages: write

defaults:
run:
shell: bash

strategy:
matrix:
config:
- {
backend: 'mpi',
tests: true,
device: '',
}
- {
backend: 'ucx',
tests: true,
device: '',
}

python-version: ['3.11']

spack-version: ['develop']

micro-arch: ['x86_64_v3']

fail-fast: false

env:
SHLVL: "1"
OMPI_ALLOW_RUN_AS_ROOT: "1"
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: "1"
SPACK_DISABLE_LOCAL_CONFIG: "true"
SPACK_USER_CACHE_PATH: "/tmp/spack"

steps:

- name: install additional ubuntu packages
run: |
sudo apt-get update -qq
sudo apt-get install -y gfortran libblas-dev

- name: clone ghex
uses: actions/checkout@v4
with:
path: ghex
submodules: recursive

- name: clone ghex spack repo
run: |
git clone --depth=1 --branch add_ghex https://github.com/boeschf/spack-repos.git repos

- name: clone spack
run: |
git clone -c feature.manyFiles=true --depth 1 \
--branch ${{ matrix.spack-version }} \
https://github.com/spack/spack.git \
spack

- name: initialize spack and add online buildcache
run: |
cat <<EOF > spack/etc/spack/config.yaml
config:
install_tree:
padded_length: 128
build_jobs: 4
EOF

cat <<EOF > spack/etc/spack/packages.yaml
packages:
all:
require:
- 'target=${{ matrix.micro-arch }}'
- '%gcc'
EOF


source spack/share/spack/setup-env.sh
spack compiler find
spack mirror add --unsigned local-buildcache oci://ghcr.io/boeschf/spack-buildcache
spack repo add repos
spack reindex

- name: build and install ghex through spack dev-build (CPU)
if: ${{ !matrix.config.device }}
run: |
source spack/share/spack/setup-env.sh
# print dependencies
spack spec -I --reuse ghex@develop \
backend=${{ matrix.config.backend }} \
^python@${{ matrix.python-version }}
# dev-build does not respect test dependencies - workaround
spack install --reuse googletest
spack load googletest
# need `--dirty` here for environment variables and googletest test dependency to propagate
spack dev-build --test=root --dirty --reuse --source-path ghex ghex@develop \
backend=${{ matrix.config.backend }} \
^python@${{ matrix.python-version }}

- name: build and install ghex through spack dev-build (GPU)
if: ${{ matrix.config.device }}
run: |
source spack/share/spack/setup-env.sh
# print dependencies
spack spec -I --reuse ghex@develop \
backend=${{ matrix.config.backend }} \
${{ matrix.config.device }} \
^python@${{ matrix.python-version }}
# dev-build
spack dev-build --dirty --reuse --source-path ghex ghex@develop \
backend=${{ matrix.config.backend }} \
${{ matrix.config.device }} \
^python@${{ matrix.python-version }}

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![CI](https://github.com/ghex-org/GHEX/actions/workflows/CI.yml/badge.svg)](https://github.com/ghex-org/GHEX/actions/workflows/CI.yml)
[![Pip](https://github.com/ghex-org/GHEX/actions/workflows/test_pip.yml/badge.svg)](https://github.com/ghex-org/GHEX/actions/workflows/test_pip.yml)
[![Spack](https://github.com/ghex-org/GHEX/actions/workflows/test_spack.yml/badge.svg)](https://github.com/ghex-org/GHEX/actions/workflows/test_spack.yml)
# GHEX
Generic exascale-ready library for halo-exchange operations on variety of grids/meshes.

Expand Down Expand Up @@ -76,6 +77,29 @@ python -m pip install 'git+https://github.com/ghex-org/GHEX.git#subdirectory=bin
| `GHEX_GPU_ARCH=` | list of archs | `"60;70;75;80"`/ `"gfx900;gfx906"` | GPU architecture
| `GHEX_TRANSPORT_BACKEND=` | `{MPI, UCX, LIBFABRIC}` | `MPI` | Choose transport backend

#### Spack Install

- make sure you have an up-to-date [spack installation](https://github.com/spack/spack)
- clone the ghex spack repo
```
git clone https://github.com/ghex-org/spack-repos.git
git clone --depth=1 ttps://github.com/boeschf/spack-repos.git path/to/ghex-repos
```
- add the repo to spack
```
spack repo add path/to/ghex-repos
spack reindex
```
- install GHEX using spack
```
spack install ghex backend=mpi
```
- for more build/install options, see
```
spack info ghex
```


### Acknowledgements

The development of GHEX was supported partly by The Partnership for Advanced
Expand Down
17 changes: 4 additions & 13 deletions bindings/python/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --annotation-style=line --extra=test --output-file=requirements-test.txt pyproject.toml
#
iniconfig==2.0.0 # via pytest
mpi4py==3.1.5 # via ghex (pyproject.toml)
numpy==1.26.2 # via ghex (pyproject.toml)
packaging==23.2 # via pytest
pluggy==1.3.0 # via pytest
pytest==7.4.3 # via ghex (pyproject.toml), pytest-mpi
pytest-mpi==0.6 # via ghex (pyproject.toml)
mpi4py
numpy
pytest
pytest-mpi
8 changes: 2 additions & 6 deletions cmake/ghex_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if (GHEX_BUILD_PYTHON_BINDINGS)
set(venv_bin_dir "${venv}/bin")
set(reqs "${PROJECT_SOURCE_DIR}/bindings/python/requirements-test.txt")
message("Creating VENV from ${Python3_EXECUTABLE} to ${VENV}")
execute_process(COMMAND_ECHO STDOUT COMMAND ${Python3_EXECUTABLE} -m venv ${venv} )
execute_process(COMMAND_ECHO STDOUT COMMAND ${venv_bin_dir}/pip install -U pip setuptools wheel pybind11-stubgen)
execute_process(COMMAND_ECHO STDOUT COMMAND ${Python3_EXECUTABLE} -m venv --system-site-packages ${venv} )
execute_process(COMMAND_ECHO STDOUT COMMAND ${venv_bin_dir}/pip install pip setuptools wheel pybind11-stubgen)
execute_process(COMMAND_ECHO STDOUT COMMAND ${venv_bin_dir}/pip install -r ${reqs} )

#execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv ${venv})
Expand All @@ -27,10 +27,6 @@ if (GHEX_BUILD_PYTHON_BINDINGS)
## Launch a new search
find_package (Python3 REQUIRED COMPONENTS Interpreter Development.Module)
else()
#if(DEFINED PYTHON_EXECUTABLE)
# set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
#endif()
#set(Python_FIND_STRATEGY LOCATION)
find_package (Python3 REQUIRED COMPONENTS Interpreter Development.Module)
endif()

Expand Down
5 changes: 2 additions & 3 deletions test/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function(ghex_reg_pytest t)
${CMAKE_CURRENT_SOURCE_DIR}/test_${t}.py)
add_test(
NAME py_${t}
COMMAND ${PYTHON_EXECUTABLE} -m pytest -s ${CMAKE_CURRENT_BINARY_DIR}/test_${t}.py
COMMAND ${venv_bin_dir}/python -m pytest -s ${CMAKE_CURRENT_BINARY_DIR}/test_${t}.py
WORKING_DIRECTORY ${pyghex_test_workdir})
set_tests_properties(py_${t} PROPERTIES RUN_SERIAL ON)
endfunction()
Expand All @@ -25,7 +25,7 @@ function(ghex_reg_parallel_pytest t n)
add_test(
NAME py_${t}_parallel
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${n} ${MPIEXEC_PREFLAGS}
${PYTHON_EXECUTABLE} -m pytest -s --with-mpi ${CMAKE_CURRENT_BINARY_DIR}/test_${t}.py
${venv_bin_dir}/python -m pytest -s --with-mpi ${CMAKE_CURRENT_BINARY_DIR}/test_${t}.py
WORKING_DIRECTORY ${pyghex_test_workdir})
set_tests_properties(py_${t}_parallel PROPERTIES RUN_SERIAL ON)
endfunction()
Expand All @@ -36,5 +36,4 @@ ghex_reg_parallel_pytest(context 4)
ghex_reg_parallel_pytest(structured_domain_descriptor 4)
ghex_reg_parallel_pytest(structured_pattern 4)

#ghex_reg_pytest(unstructured_domain_descriptor)
ghex_reg_parallel_pytest(unstructured_domain_descriptor 4)