Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dependent tasks #306

Merged
merged 22 commits into from
Apr 22, 2024
Merged

Add support for dependent tasks #306

merged 22 commits into from
Apr 22, 2024

Conversation

jan-janssen
Copy link
Member

@jan-janssen jan-janssen commented Apr 21, 2024

from time import sleep
from pympipool import Executor

def add_function(parameter_1, parameter_2):
    sleep(1)
    return parameter_1 + parameter_2

with Executor(max_cores=1, backend="mpi") as exe:
    future_1 = exe.submit(add_function, 1, parameter_2=2)
    future_2 = exe.submit(add_function, 1, parameter_2=future_1)
    print(future_2.result())

@jan-janssen jan-janssen marked this pull request as draft April 21, 2024 20:05
@jan-janssen jan-janssen marked this pull request as ready for review April 21, 2024 21:01
@jan-janssen jan-janssen added the format_black reformat the code using the black standard label Apr 22, 2024
pyiron-runner and others added 2 commits April 22, 2024 00:49
@jan-janssen jan-janssen linked an issue Apr 22, 2024 that may be closed by this pull request
@jan-janssen jan-janssen merged commit 86d7ea5 into main Apr 22, 2024
21 of 22 checks passed
@jan-janssen jan-janssen deleted the dependencies branch April 22, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black reformat the code using the black standard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Dependencies between submitted functions
2 participants