Skip to content

Commit fed67f1

Browse files
committed
Enable checking of the OTF2 file for the MPI testcase
Requires disabling the instrumenter on startup as otherwise the trace gets so large (124k events) that reading it in Python takes forever
1 parent 7ce7756 commit fed67f1

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

test/cases/mpi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env python
22

3+
import scorep
34
from mpi4py import MPI
45
import numpy as np
56
import mpi4py
67
import instrumentation2
78
mpi4py.rc.thread_level = "funneled"
89

10+
scorep.instrumenter.register()
911

1012
comm = mpi4py.MPI.COMM_WORLD
1113

test/test_scorep.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ def test_error_region(scorep_env, instrumenter):
233233
@requires_package('numpy')
234234
@foreach_instrumenter
235235
def test_mpi(scorep_env, instrumenter):
236+
trace_path = get_trace_path(scorep_env)
236237
std_out, std_err = call(["mpirun",
237238
"-n",
238239
"2",
@@ -244,6 +245,7 @@ def test_mpi(scorep_env, instrumenter):
244245
"scorep",
245246
"--mpp=mpi",
246247
"--nocompiler",
248+
"--noinstrumenter",
247249
"--instrumenter-type=" + instrumenter,
248250
"cases/mpi.py"],
249251
env=scorep_env)
@@ -253,6 +255,13 @@ def test_mpi(scorep_env, instrumenter):
253255
assert re.search(r'\[Score-P\] [\w/.: ]*MPI_THREAD_FUNNELED', std_err)
254256
assert re.search(expected_std_out, std_out)
255257

258+
std_out, std_err = call(["otf2-print", trace_path])
259+
260+
assert std_err == ""
261+
for func in ('instrumentation2:bar', 'instrumentation2:baz'):
262+
for event in ('ENTER', 'LEAVE'):
263+
assert re.search('%s[ ]*[0-9 ]*[0-9 ]*Region: "%s"' % (event, func), std_out)
264+
256265

257266
@foreach_instrumenter
258267
def test_call_main(scorep_env, instrumenter):

0 commit comments

Comments
 (0)