Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docs/source/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ input for the second function during the submission. Consequently, this function
graphs, still it does not enable cyclic graphs. As a simple example we can add one to the result of the addition of one
and two:
```python
import flux.job
from pympipool import Executor

def calc_function(parameter_a, parameter_b):
Expand All @@ -403,13 +404,15 @@ with flux.job.FluxExecutor() as flux_exe:
with Executor(max_cores=2, executor=flux_exe) as exe:
future_1 = exe.submit(
calc_function,
parameter_a=1,
parameter_b=2,
1,
parameter_b=2,
resource_dict={"cores": 1},
)
future_2 = exe.submit(
calc_function,
parameter_a=1,
parameter_b=future_1,
1,
parameter_b=future_1,
resource_dict={"cores": 1},
)
print(future_2.result())
```
Expand Down Expand Up @@ -452,7 +455,7 @@ Still the general usage of `pympipool` remains similar:
from pympipool import Executor

with Executor(max_cores=1, backend="mpi") as exe:
future = exe.submit(sum, [1,1])
future = exe.submit(sum, [1,1], resource_dict={"cores": 1})
print(future.result())
```
The `backend="mpi"` parameter is optional as `pympipool` automatically recognizes if [flux framework](https://flux-framework.org)
Expand Down
Loading