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

ci: tweak mpi setup to allow -s and hide output #2350

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
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
16 changes: 14 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,28 @@ def parallel(item, m):
raise ValueError("Can't run test: unexpected mode `%s`" % m)

pyversion = sys.executable

# Keep all invocation arguments up to test path
params = item.config.invocation_params.args
pyarg = []
for p in params:
if p.startswith('tests'):
break
else:
pyarg.append(p)

# Only spew tracebacks on rank 0.
# Run xfailing tests to ensure that errors are reported to calling process
if item.cls is not None:
testname = "%s::%s::%s" % (item.fspath, item.cls.__name__, item.name)
else:
testname = "%s::%s" % (item.fspath, item.name)
args = ["-n", "1", pyversion, "-m", "pytest", "--runxfail", "-q", testname]

args = ["-n", "1", pyversion, "-m", "pytest", "--no-summary", *pyarg,
"--runxfail", "-qq", testname]
if nprocs > 1:
args.extend([":", "-n", "%d" % (nprocs - 1), pyversion, "-m", "pytest",
"--runxfail", "--tb=no", "-q", testname])
"-s", "--runxfail", "--tb=no", "-qq", "--no-summary", testname])
# OpenMPI requires an explicit flag for oversubscription. We need it as some
# of the MPI tests will spawn lots of processes
if mpi_distro == 'OpenMPI':
Expand Down
3 changes: 1 addition & 2 deletions tests/test_linearize.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_interpolation_msf():
assert op1.cfunction


@pytest.mark.parallel(mode=[(1, 'diag2')])
@pytest.mark.parallel(mode=[(2, 'diag2')])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 1 was fine here

def test_codegen_quality0(mode):
grid = Grid(shape=(4, 4))
u = TimeFunction(name='u', grid=grid, space_order=2)
Expand All @@ -170,7 +170,6 @@ def test_codegen_quality0(mode):
# for the efunc args
# (the other three obviously are _POSIX_C_SOURCE, START, STOP)
assert len(op._headers) == 6
return "bonjour"


def test_codegen_quality1():
Expand Down
Loading