Skip to content

Commit

Permalink
Add skip if system doesn't have sufficient number of CPUs (#140)
Browse files Browse the repository at this point in the history
* Add skip if system doesn't have sufficient number of CPUs

* Sort improts
  • Loading branch information
jorgensd authored Nov 20, 2024
1 parent 191b3e2 commit 185e7d7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_original_checkpoint.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import itertools
import os
from collections.abc import Callable
from pathlib import Path

Expand Down Expand Up @@ -270,6 +271,9 @@ def read_function_vector(
np.testing.assert_allclose(u.x.array, u_ex.x.array, atol=atol) # type: ignore


@pytest.mark.skipif(
os.cpu_count() == 1, reason="Test requires that the system has more than one process"
)
@pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="Test uses ipythonparallel for MPI")
@pytest.mark.parametrize("is_complex", [True, False])
@pytest.mark.parametrize("family", ["Lagrange", "DG"])
Expand Down Expand Up @@ -314,6 +318,9 @@ def f(x):
assert query.successful(), query.error


@pytest.mark.skipif(
os.cpu_count() == 1, reason="Test requires that the system has more than one process"
)
@pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="Test uses ipythonparallel for MPI")
@pytest.mark.parametrize("is_complex", [True, False])
@pytest.mark.parametrize("family", ["Lagrange", "DG"])
Expand Down Expand Up @@ -360,6 +367,9 @@ def f(x):
assert query.successful(), query.error


@pytest.mark.skipif(
os.cpu_count() == 1, reason="Test requires that the system has more than one process"
)
@pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="Test uses ipythonparallel for MPI")
@pytest.mark.parametrize("write_mesh", [True, False])
@pytest.mark.parametrize("is_complex", [True, False])
Expand Down Expand Up @@ -397,6 +407,9 @@ def f(x):
read_function_vector(mesh_fname, file_path, "u_original", family, degree, f, f_dtype)


@pytest.mark.skipif(
os.cpu_count() == 1, reason="Test requires that the system has more than one process"
)
@pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="Test uses ipythonparallel for MPI")
@pytest.mark.parametrize("write_mesh", [True, False])
@pytest.mark.parametrize("is_complex", [True, False])
Expand Down Expand Up @@ -435,6 +448,9 @@ def f(x):
read_function_vector(mesh_fname, file_path, "u_original", family, degree, f, f_dtype)


@pytest.mark.skipif(
os.cpu_count() == 1, reason="Test requires that the system has more than one process"
)
@pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="Test uses ipythonparallel for MPI")
@pytest.mark.parametrize("write_mesh", [True, False])
@pytest.mark.parametrize("is_complex", [True, False])
Expand Down Expand Up @@ -472,6 +488,9 @@ def f(x):
read_function_vector(mesh_fname, file_path, "u_original", family, degree, f, f_dtype)


@pytest.mark.skipif(
os.cpu_count() == 1, reason="Test requires that the system has more than one process"
)
@pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="Test uses ipythonparallel for MPI")
@pytest.mark.parametrize("write_mesh", [True, False])
@pytest.mark.parametrize("is_complex", [True, False])
Expand Down

0 comments on commit 185e7d7

Please sign in to comment.