Skip to content

Commit 86ae6a8

Browse files
committed
wip
1 parent 6ff1e91 commit 86ae6a8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/build_cuda.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
git clone --depth 1 --branch $(python3 ./firedrake-repo/scripts/firedrake-configure --show-petsc-version) https://gitlab.com/petsc/petsc.git
8585
cd petsc
8686
# TODO update configure file
87-
./configure --with-make-np=8 --with-c2html=0 --with-debugging=0 --with-fortran-bindings=0 --with-shared-libraries=1 --with-strict-petscerrorcode PETSC_ARCH=arch-firedrake-default --COPTFLAGS=-O3 -march=native -mtune=native --CXXOPTFLAGS=-O3 -march=native -mtune=native --FOPTFLAGS=-O3 -march=native -mtune=native --download-bison --download-fftw --download-hdf5 --download-hwloc --download-metis --download-mumps --download-netcdf --download-pnetcdf --download-ptscotch --download-scalapack --download-suitesparse --download-superlu_dist --download-zlib --download-hypre --with-cuda --with-cuda-dir=/usr/local/cuda CUDAPPFLAGS=-Wno-deprecated-gpu-targets --download-openmpi --download-slepc
87+
./configure --with-make-np=8 --with-c2html=0 --with-debugging=0 --with-fortran-bindings=0 --with-shared-libraries=1 --with-strict-petscerrorcode PETSC_ARCH=arch-firedrake-default --COPTFLAGS=-O3 -march=native -mtune=native --CXXOPTFLAGS=-O3 -march=native -mtune=native --FOPTFLAGS=-O3 -march=native -mtune=native --download-bison --download-fftw --download-hdf5 --download-hwloc --download-metis --download-mumps --download-netcdf --download-pnetcdf --download-ptscotch --download-scalapack --download-suitesparse --download-superlu_dist --download-zlib --with-cuda --with-cuda-dir=/usr/local/cuda CUDAPPFLAGS=-Wno-deprecated-gpu-targets --download-openmpi --download-slepc
8888
make PETSC_DIR=/__w/firedrake/firedrake/petsc PETSC_ARCH=arch-firedrake-default all
8989
export PETSC_DIR=/__w/firedrake/firedrake/petsc
9090
export PETSC_ARCH=arch-firedrake-default
@@ -95,7 +95,6 @@ jobs:
9595
export PATH=$PETSC_DIR/$PETSC_ARCH/bin:$PATH
9696
export SLEPC_DIR=$PETSC_DIR/$PETSC_ARCH
9797
export HDF5_DIR=$PETSC_DIR/$PETSC_ARCH
98-
export HYPRE_DIR=$PETSC_DIR/$PETSC_ARCH
9998
export HDF5_MPI=ON
10099
make PETSC_DIR=/__w/firedrake/firedrake/petsc PETSC_ARCH=arch-firedrake-default check MPIEXEC="mpiexec --allow-run-as-root"
101100
@@ -113,7 +112,6 @@ jobs:
113112
export PATH=$PETSC_DIR/$PETSC_ARCH/bin:$PATH
114113
export SLEPC_DIR=$PETSC_DIR/$PETSC_ARCH
115114
export HDF5_DIR=$PETSC_DIR/$PETSC_ARCH
116-
export HYPRE_DIR=$PETSC_DIR/$PETSC_ARCH
117115
export HDF5_MPI=ON
118116
python3 -m venv venv
119117
. venv/bin/activate

tests/firedrake/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,24 @@ def pytest_configure(config):
149149
"markers",
150150
"skipcuda: mark as skipped if CUDA is not available"
151151
)
152+
config.addinivalue_line(
153+
"markers",
154+
"skipgpu: mark as skipped if a GPU enabled PETSC was installed"
155+
)
152156

153157

154158
def pytest_collection_modifyitems(session, config, items):
155159
from firedrake.utils import complex_mode, SLATE_SUPPORTS_COMPLEX
156160

157161
try:
158162
get_petsc_variables()["CUDA_VERSION"]
163+
# They look like the same thing (but opposite) for now, but they are not.
164+
# This will skip some nongpurelated tests (hypre) if a gpu-aware petsc was installed.
159165
cuda_unavailable = False
166+
gpu_based_petsc = True
160167
except:
161168
cuda_unavailable = True
169+
gpu_based_petsc = False
162170

163171
for item in items:
164172
if complex_mode:
@@ -173,6 +181,10 @@ def pytest_collection_modifyitems(session, config, items):
173181
if cuda_unavailable:
174182
if item.get_closest_marker("skipcuda") is not None:
175183
item.add_marker(pytest.mark.skip(reason="CUDA not available"))
184+
185+
if gpu_based_petsc:
186+
if item.get_closest_marker("skipgpu") is not None:
187+
item.add_marker(pytest.mark.skip(reason="Test skipped on gpu-based install"))
176188

177189
for dep, marker, reason in dependency_skip_markers_and_reasons:
178190
if _skip_test_dependency(dep) and item.get_closest_marker(marker) is not None:

tests/firedrake/demos/test_demos_run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def _exec_file(py_file):
117117

118118

119119
@pytest.mark.skipcomplex
120+
@pytest.mark.skipgpu
120121
@pytest.mark.parametrize("demo", SERIAL_DEMOS, ids=["/".join(d.loc) for d in SERIAL_DEMOS])
121122
def test_serial_demo(demo, env, monkeypatch, tmpdir, skip_dependency):
122123
_maybe_skip_demo(demo, skip_dependency)
@@ -130,6 +131,7 @@ def test_serial_demo(demo, env, monkeypatch, tmpdir, skip_dependency):
130131

131132
@pytest.mark.parallel(2)
132133
@pytest.mark.skipcomplex
134+
@pytest.mark.skipgpu
133135
@pytest.mark.parametrize("demo", PARALLEL_DEMOS, ids=["/".join(d.loc) for d in PARALLEL_DEMOS])
134136
def test_parallel_demo(demo, env, monkeypatch, tmpdir, skip_dependency):
135137
_maybe_skip_demo(demo, skip_dependency)

0 commit comments

Comments
 (0)