Commit 1a6fdd9f authored by Shane Snyder's avatar Shane Snyder
Browse files

Merge branch 'treddy_test_dxt_simple' into 'master'

TST: add DXT testing to pydarshan

See merge request !105
parents da63fe1a c877e9b2
import os
import pytest
import darshan.backend.cffi_backend as backend
@pytest.mark.parametrize("logfile", [
# an incredibly simple darshan DXT trace
# of a small sample C MPI-IO program from
# https://wgropp.cs.illinois.edu/courses/cs598-s15/lectures/lecture32.pdf
"sample-dxt-simple.darshan",
])
@pytest.mark.parametrize("mod, expected_dict", [
('DXT_POSIX', {'id': 14388265063268455899,
'rank': 0,
'hostname': 'sn176.localdomain',
'write_count': 1,
'read_count': 0,
'write_segments': [{'offset': 0,
'length': 40,
'start_time': 0.10337884305045009,
'end_time': 0.10338771319948137}],
'read_segments': []}),
('DXT_MPIIO', {'id': 9457796068806373448,
'rank': 0,
'hostname': 'sn176.localdomain',
'write_count': 1,
'read_count': 0,
'write_segments': [{'offset': 0,
'length': 4000,
'start_time': 0.10368914622813463,
'end_time': 0.1053433942142874}],
'read_segments': []})])
def test_dxt_records(logfile, mod, expected_dict):
# regression guard for DXT records values
logfile = os.path.join("tests/input", logfile)
log = backend.log_open(logfile)
rec = backend.log_get_record(log, mod)
assert rec == expected_dict
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment