Skip to content

Commit 7f56240

Browse files
jan-janssenclaude
andcommitted
[Docs] add docstring to _execute_init_dict
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent efe81db commit 7f56240

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/executorlib/backend/interactive_parallel.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ def _execute_init_dict(
2323
mpi_rank_zero: bool,
2424
mpi_size_larger_one: bool,
2525
) -> None:
26+
"""
27+
Execute an init-function message and update the in-process memory store.
28+
29+
Runs the callable in input_dict on every MPI rank, then gathers errors
30+
from all ranks to rank 0 so that a failure on any non-zero rank is not
31+
silently swallowed. Rank 0 sends the result or the first observed error
32+
back to the scheduler via the ZMQ socket.
33+
34+
Args:
35+
input_dict (dict): Message dict with keys "init", "fn", "args", "kwargs".
36+
memory (dict): Per-rank memory store; updated in-place with the return
37+
value of the init function on success.
38+
socket (zmq.Socket | None): ZMQ socket used by rank 0 to reply to the
39+
scheduler; None on non-zero ranks.
40+
mpi_rank_zero (bool): True only on MPI rank 0.
41+
mpi_size_larger_one (bool): True when the communicator has more than one rank.
42+
"""
2643
from mpi4py import MPI
2744

2845
init_error = None

0 commit comments

Comments
 (0)