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

[documentation] Add an example with a for-loop - to demonstrate how to accelerate a workflow #244

Open
jan-janssen opened this issue Jan 3, 2024 · 1 comment

Comments

@jan-janssen
Copy link
Member

Currently, theresult() call right after thesubmit() gives the impression that both lines should follow each other.

@jan-janssen
Copy link
Member Author

jan-janssen commented Apr 21, 2024

import flux.job
from pympipool import Executor

with flux.job.FluxExecutor() as flux_exe:
    with Executor(max_cores=1, executor=flux_exe) as exe:
        future_lst = [exe.submit(sum, [i,i]) for i in range(10)]
        print([future.result() for future in future_lst])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant