Skip to content

Commit

Permalink
Use DeVito's par-tile.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Aug 8, 2023
1 parent 5ff217d commit 51028d2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fast/diffusion_2D_wBCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
eq_stencil = Eq(u.forward, stencil)

if args.devito:
op = Operator([eq_stencil], name='DevitoOperator')
op = Operator([eq_stencil], name='DevitoOperator', opt=('advanced', {'par-tile': (32,4,8)}))
op.apply(time=nt, dt=dt, a=nu)
print("Devito Field norm is:", norm(u))

Expand Down
2 changes: 1 addition & 1 deletion fast/diffusion_3D_wBCs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def plot_3dfunc(u):

# Create Operator
if args.devito:
op = Operator([eq_stencil], name='DevitoOperator')
op = Operator([eq_stencil], name='DevitoOperator', opt=('advanced', {'par-tile': (32,4,8)}))
# Apply the operator for a number of timesteps
op.apply(time=nt, dt=dt, a=nu)
print("Devito Field norm is:", norm(u))
Expand Down
5 changes: 2 additions & 3 deletions fast/wave2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
if args.plot:
plot_2dfunc(u)

import pdb;pdb.set_trace()
# print("Init Devito linalg norm 0 :", np.linalg.norm(u.data[0]))
# print("Init Devito linalg norm 1 :", np.linalg.norm(u.data[1]))
# print("Init Devito linalg norm 2 :", np.linalg.norm(u.data[2]))
Expand All @@ -120,7 +119,7 @@

if args.devito:
# Run more with no sources now (Not supported in xdsl)
op1 = Operator([stencil], name='DevitoOperator')
op1 = Operator([stencil], name='DevitoOperator', opt=('advanced', {'par-tile': (32,4,8)}))
op1.apply(time=time_range.num-1, dt=model.critical_dt)

configuration['mpi'] = 0
Expand Down Expand Up @@ -148,7 +147,7 @@
# print("XDSL init linalg norm:", np.linalg.norm(u.data[2]))

# Run more with no sources now (Not supported in xdsl)
xdslop = Operator([stencil], name='xDSLOperator')
xdslop = XDSLOperator([stencil], name='xDSLOperator')
xdslop.apply(time=time_range.num-1, dt=model.critical_dt)

if len(shape) == 2 and args.plot:
Expand Down
2 changes: 1 addition & 1 deletion fast/wave3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
configuration['mpi'] = mpiconf

# Run more with no sources now (Not supported in xdsl)
op1 = Operator([stencil], name='DevitoOperator')
op1 = Operator([stencil], name='DevitoOperator', opt=('advanced', {'par-tile': (32,4,8)}))
op1.apply(time=time_range.num-1, dt=model.critical_dt)

configuration['mpi'] = 0
Expand Down

0 comments on commit 51028d2

Please sign in to comment.