Skip to content

Commit 5ffeb01

Browse files
committed
log event buffer choice, update test
1 parent 1d6866b commit 5ffeb01

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

autotest/test_prt_voronoi1.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def build_gwf_sim(name, ws, targets):
159159
}
160160

161161

162-
def build_prt_sim(idx, name, gwf_ws, prt_ws, targets, cell_ids):
162+
def build_prt_sim(idx, name, gwf_ws, prt_ws, targets, cell_ids, scratch_buffer=False):
163163
prt_ws = Path(prt_ws)
164164
gwf_name = get_model_name(name, "gwf")
165165
prt_name = get_model_name(name, "prt")
@@ -224,6 +224,7 @@ def build_prt_sim(idx, name, gwf_ws, prt_ws, targets, cell_ids):
224224
track_usertime=times[idx],
225225
ntracktimes=len(tracktimes) if times[idx] else None,
226226
tracktimes=[(t,) for t in tracktimes] if times[idx] else None,
227+
scratch_buffer=scratch_buffer,
227228
)
228229
gwf_budget_file = gwf_ws / f"{gwf_name}.bud"
229230
gwf_head_file = gwf_ws / f"{gwf_name}.hds"
@@ -235,10 +236,16 @@ def build_prt_sim(idx, name, gwf_ws, prt_ws, targets, cell_ids):
235236
return sim
236237

237238

238-
def build_models(idx, test):
239+
def build_models(idx, test, scratch_buffer=False):
239240
gwf_sim, cell_ids = build_gwf_sim(test.name, test.workspace, test.targets)
240241
prt_sim = build_prt_sim(
241-
idx, test.name, test.workspace, test.workspace / "prt", test.targets, cell_ids
242+
idx,
243+
test.name,
244+
test.workspace,
245+
test.workspace / "prt",
246+
test.targets,
247+
cell_ids,
248+
scratch_buffer,
242249
)
243250
return gwf_sim, prt_sim
244251

@@ -357,11 +364,12 @@ def check_output(idx, test):
357364
@requires_pkg("syrupy")
358365
@pytest.mark.slow
359366
@pytest.mark.parametrize("idx, name", enumerate(cases))
360-
def test_mf6model(idx, name, function_tmpdir, targets, benchmark, plot):
367+
@pytest.mark.parametrize("scratch_buffer", [False, True], ids=["inmem", "scratch"])
368+
def test_mf6model(scratch_buffer, idx, name, function_tmpdir, targets, benchmark, plot):
361369
test = TestFramework(
362370
name=name,
363371
workspace=function_tmpdir,
364-
build=lambda t: build_models(idx, t),
372+
build=lambda t: build_models(idx, t, scratch_buffer),
365373
check=lambda t: check_output(idx, t),
366374
plot=lambda t: plot_output(idx, t) if plot else None,
367375
targets=targets,

src/Model/ParticleTracking/prt-oc.f90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ subroutine prt_oc_source_options(this)
269269
if (found%dev_dump_evtrace) this%dump_event_trace = .true.
270270
if (found%scratch_buffer) this%scratch_buffer = .true.
271271

272+
if (this%scratch_buffer) then
273+
write (this%iout, '(4x,a)') 'TRACK EVENT BUFFER: SCRATCH FILE'
274+
else
275+
write (this%iout, '(4x,a)') 'TRACK EVENT BUFFER: MEMORY'
276+
end if
277+
272278
! default to all events
273279
if (.not. (found%track_release .or. &
274280
found%track_exit .or. &

0 commit comments

Comments
 (0)