Skip to content

Commit

Permalink
examples: Update with edge case of 03_PML notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Nov 4, 2024
1 parent 460a817 commit 3ba057d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
1 change: 0 additions & 1 deletion devito/ir/iet/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,6 @@ def __repr__(self):
fstrings = []
for f in self.functions:
loc_indices = set().union(*[self.halo_scheme.fmapper[f].loc_indices.values()])
loc_indices = list(loc_indices)
loc_indices_str = str(list(loc_indices)) if loc_indices else ""

fstrings.append(f"{f.name}{loc_indices_str}")
Expand Down
13 changes: 9 additions & 4 deletions devito/passes/iet/mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,15 @@ def _process_halo_to_halo(hs0, hs1, iters, scopes, hsmapper, imapper):
# the loc_indices with known values
# TODO: Can I get this in a more elegant way?
for d in hse.loc_indices:
root_min = hse.loc_indices[d].symbolic_min
new_min = root_min.subs(hse.loc_indices[d].root,
hse.loc_indices[d].root.symbolic_min)
raw_loc_indices[d] = new_min
if hse.loc_indices[d].is_Symbol:
assert d in hse.loc_indices[d]._defines
root_min = hse.loc_indices[d].symbolic_min
new_min = root_min.subs(hse.loc_indices[d].root,
hse.loc_indices[d].root.symbolic_min)
raw_loc_indices[d] = new_min
else:
assert d.symbolic_min in hse.loc_indices[d].free_symbols
raw_loc_indices[d] = hse.loc_indices[d]

hse = hse.rebuild(loc_indices=frozendict(raw_loc_indices))
hs1.halo_scheme.fmapper[f] = hse
Expand Down
12 changes: 1 addition & 11 deletions examples/mpi/overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,7 @@
"output_type": "stream",
"text": [
"[stderr:0] \n",
"Operator `Kernel` ran in 0.01 s\n",
"INFO:Devito:Operator `Kernel` ran in 0.01 s\n",
"[stderr:1] \n",
"Operator `Kernel` ran in 0.01 s\n",
"INFO:Devito:Operator `Kernel` ran in 0.01 s\n",
"[stderr:2] \n",
"Operator `Kernel` ran in 0.01 s\n",
"INFO:Devito:Operator `Kernel` ran in 0.01 s\n",
"[stderr:3] \n",
"Operator `Kernel` ran in 0.01 s\n",
"INFO:Devito:Operator `Kernel` ran in 0.01 s\n"
"Operator `Kernel` ran in 0.01 s\n"
]
}
],
Expand Down
8 changes: 3 additions & 5 deletions examples/seismic/abc_methods/03_pml.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,8 @@
"# NBVAL_IGNORE_OUTPUT\n",
"\n",
"%matplotlib inline\n",
"from examples.seismic import TimeAxis\n",
"from examples.seismic import RickerSource\n",
"from examples.seismic import Receiver\n",
"from devito import SubDomain, Grid, NODE, TimeFunction, Function, Eq, solve, Operator"
"from devito import SubDomain, Grid, NODE, TimeFunction, Function, Eq, solve, Operator\n",
"from examples.seismic import TimeAxis, RickerSource, Receiver"
]
},
{
Expand All @@ -205,7 +203,7 @@
"compx = x1-x0\n",
"z0 = 0.\n",
"z1 = 1000.\n",
"compz = z1-z0;\n",
"compz = z1-z0\n",
"hxv = (x1-x0)/(nptx-1)\n",
"hzv = (z1-z0)/(nptz-1)"
]
Expand Down

0 comments on commit 3ba057d

Please sign in to comment.