88 get_future_done ,
99 execute_task_dict ,
1010)
11- from pympipool .interfaces .base import ExecutorBase
11+ from pympipool .shared .base import ExecutorBase
1212from pympipool .shared .thread import RaisingThread
1313from pympipool .shared .taskexecutor import (
1414 cloudpickle_register ,
@@ -34,23 +34,23 @@ class SingleTaskExecutor(ExecutorBase):
3434
3535 Simple example:
3636 ```
37- import numpy as np
38- from pympipool import Executor
39-
40- def calc(i, j, k):
41- from mpi4py import MPI
42- size = MPI.COMM_WORLD.Get_size()
43- rank = MPI.COMM_WORLD.Get_rank()
44- return np.array([i, j, k]), size, rank
45-
46- def init_k():
47- return {"k": 3}
48-
49- with Executor(cores=2, init_function=init_k) as p:
50- fs = p.submit(calc, 2, j=4)
51- print(fs.result())
52-
53- >>> [(array([2, 4, 3]), 2, 0), (array([2, 4, 3]), 2, 1)]
37+ >>> import numpy as np
38+ >>> from pympipool import Executor
39+ >>>
40+ >>> def calc(i, j, k):
41+ >>> from mpi4py import MPI
42+ >>> size = MPI.COMM_WORLD.Get_size()
43+ >>> rank = MPI.COMM_WORLD.Get_rank()
44+ >>> return np.array([i, j, k]), size, rank
45+ >>>
46+ >>> def init_k():
47+ >>> return {"k": 3}
48+ >>>
49+ >>> with Executor(cores=2, init_function=init_k) as p:
50+ >>> fs = p.submit(calc, 2, j=4)
51+ >>> print(fs.result())
52+
53+ [(array([2, 4, 3]), 2, 0), (array([2, 4, 3]), 2, 1)]
5454 ```
5555 """
5656
0 commit comments