Skip to content

Commit

Permalink
mpi: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Aug 2, 2023
1 parent bacf1af commit 7f3b37e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion fast/wave2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def plot_2dfunc(u):
if args.plot:
plot_3dfunc(u)

#devito_output = u.data[:]
print("After Operator 1: Devito norm:", norm(u))
print("Devito linalg norm 0:", np.linalg.norm(u.data[0]))
print("Devito linalg norm 1:", np.linalg.norm(u.data[1]))
Expand Down
10 changes: 5 additions & 5 deletions fast/wave3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def plot_3dfunc(u):

# Define the wavefield with the size of the model and the time dimension
u = TimeFunction(name="u", grid=model.grid, time_order=to, space_order=so)

# Another one to clone data
u2 = TimeFunction(name="u", grid=model.grid, time_order=to, space_order=so)

# We can now write the PDE
Expand All @@ -111,7 +111,7 @@ def plot_3dfunc(u):
# the corresponding code
print(time_range)

print("Init norm:", norm(u))
print("Init norm:", np.linalg.norm(u.data[:]))
src_term = src.inject(field=u.forward, expr=src * dt**2 / model.m)
op0 = Operator([stencil] + src_term, subs=model.spacing_map, name='SourceDevitoOperator')
# Run with source and plot
Expand All @@ -124,8 +124,8 @@ def plot_3dfunc(u):
print("Init linalg norm 0 :", np.linalg.norm(u.data[0]))
print("Init linalg norm 1 :", np.linalg.norm(u.data[1]))
print("Init linalg norm 2 :", np.linalg.norm(u.data[2]))

print("Norm of initial data:", np.linalg.norm(u.data[:]))

configuration['mpi'] = 0
u2.data[:] = u.data[:]
configuration['mpi'] = 'basic'
Expand All @@ -139,7 +139,7 @@ def plot_3dfunc(u):
plot_3dfunc(u)

#devito_output = u.data[:]
print("After Operator 1: Devito norm:", norm(u))
print("After Operator 1: Devito norm:", np.linalg.norm(u.data[:]))
print("Devito linalg norm 0:", np.linalg.norm(u.data[0]))
print("Devito linalg norm 1:", np.linalg.norm(u.data[1]))
print("Devito linalg norm 2:", np.linalg.norm(u.data[2]))
Expand All @@ -150,7 +150,7 @@ def plot_3dfunc(u):
configuration['mpi'] = 'basic'
#v[:, ..., :] = 1

print("Reinitialise data: Devito norm:", np.linalg.norm(u.data[:]))
print("Reinitialise data for XDSL:", np.linalg.norm(u.data[:]))
print("Init XDSL linalg norm:", np.linalg.norm(u.data[0]))
print("Init XDSL linalg norm:", np.linalg.norm(u.data[1]))
print("Init XDSL linalg norm:", np.linalg.norm(u.data[2]))
Expand Down

0 comments on commit 7f3b37e

Please sign in to comment.