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

Add skip if system doesn't have sufficient number of CPUs #140

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Changes from all commits
Commits
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
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