Skip to content

Commit

Permalink
update to Parallel_Meep.md for missing chunk layout file
Browse files Browse the repository at this point in the history
  • Loading branch information
bencbartlett committed Oct 7, 2021
1 parent e3ed37b commit 371d1f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions doc/docs/Parallel_Meep.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,13 @@ import meep as mp
from meep.chunk_balancer import ChunkBalancer
from meep.timing_measurements import MeepTimingMeasurements
import pickle
import os.path

# Fetch chunk layout from a previous run
with open("path/to/chunk_layout.pkl", "rb") as f:
chunk_layout = pickle.load(f)
# Fetch chunk layout from a previous run if it exists
if os.path.exists("path/to/chunk_layout.pkl"):
chunk_layout = pickle.load(open("path/to/chunk_layout.pkl", "rb"))
else:
chunk_layout = None

sim = mp.Simulation(..., chunk_layout=chunk_layout)
sim.init_sim()
Expand Down

0 comments on commit 371d1f3

Please sign in to comment.