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

Workflow that does not block. #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

drewoldag
Copy link
Collaborator

A workflow that doesn't block later execution by waiting for all instances of prior tasks to complete.

To run this locally, have parsl installed and from the top level source directory run:

>> python ./src/kbmod_wf/simple_workflow.py --env=dev 

#Expected output:
Starting workflow
Step 1: key: ants, slept: 4
Step 1: key: bees, slept: 3
Step 1: key: elephants, slept: 2
Step 1: key: frogs, slept: 1
Step 2: key: ants.txt
Step 2: key: bees.txt
Step 2: key: elephants.txt
Step 1: key: dogs, slept: 14
Step 2: key: frogs.txt
Step 1: key: cats, slept: 15
Step 2: key: dogs.txt
Step 2: key: cats.txt
Workflow complete

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic happens on lines 28 and 72.

Note that in the for loop, we're not calling f.result(), but instead simply f. And in the task definition, we're calling inputs[0].filepath.

Copy link
Collaborator

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants