MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / Sync

Class Sync

dedalus/tools/parallel.py:10–35  ·  view source on GitHub ↗

Context manager for synchronizing MPI processes. Parameters ---------- enter : boolean, optional Apply MPI barrier on entering context. Default: True exit : boolean, optional Apply MPI barrier on exiting context. Default: True

Source from the content-addressed store, hash-verified

8
9
10class Sync:
11 """
12 Context manager for synchronizing MPI processes.
13
14 Parameters
15 ----------
16 enter : boolean, optional
17 Apply MPI barrier on entering context. Default: True
18 exit : boolean, optional
19 Apply MPI barrier on exiting context. Default: True
20
21 """
22
23 def __init__(self, comm=MPI.COMM_WORLD, enter=True, exit=True):
24 self.comm = comm
25 self.enter = enter
26 self.exit = exit
27
28 def __enter__(self):
29 if self.enter:
30 self.comm.Barrier()
31 return self
32
33 def __exit__(self, type, value, traceback):
34 if self.exit:
35 self.comm.Barrier()
36
37
38class RotateProcesses:

Callers 15

plot_snapshots.pyFile · 0.90
plot_shell.pyFile · 0.90
plot_ball.pyFile · 0.90
plot_sphere.pyFile · 0.90
plot_snapshots.pyFile · 0.90
plot_polar.pyFile · 0.90
plot_disk.pyFile · 0.90
test_cartesian_outputFunction · 0.90
parallel_mkdirFunction · 0.85

Calls

no outgoing calls