Skip to content

Commit bc521de

Browse files
wave-op-mpi: add simple timing (#197)
* wave-op-mpi: add simple timing * fix
1 parent 504d8df commit bc521de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/wave/wave-op-mpi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ def rhs(t, w):
224224
if comm.rank == 0:
225225
logger.info("dt = %g", dt)
226226

227+
import time
228+
start = time.time()
229+
227230
t = 0
228231
t_final = 3
229232
istep = 0
@@ -236,6 +239,7 @@ def rhs(t, w):
236239
l2norm = actx.to_numpy(op.norm(dcoll, fields.u, 2))
237240

238241
if istep % 10 == 0:
242+
stop = time.time()
239243
linfnorm = actx.to_numpy(op.norm(dcoll, fields.u, np.inf))
240244
nodalmax = actx.to_numpy(op.nodal_max(dcoll, "vol", fields.u))
241245
nodalmin = actx.to_numpy(op.nodal_min(dcoll, "vol", fields.u))
@@ -244,7 +248,8 @@ def rhs(t, w):
244248
f"L2: {l2norm} "
245249
f"Linf: {linfnorm} "
246250
f"sol max: {nodalmax} "
247-
f"sol min: {nodalmin}")
251+
f"sol min: {nodalmin} "
252+
f"wall: {stop-start} ")
248253
if visualize:
249254
vis.write_parallel_vtk_file(
250255
comm,
@@ -254,6 +259,7 @@ def rhs(t, w):
254259
("v", fields.v),
255260
]
256261
)
262+
start = stop
257263

258264
t += dt
259265
istep += 1

0 commit comments

Comments
 (0)