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

compound workflow with makefile style target #1201

Closed
BoPeng opened this issue Jan 31, 2019 · 1 comment
Closed

compound workflow with makefile style target #1201

BoPeng opened this issue Jan 31, 2019 · 1 comment

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Jan 31, 2019

Running the following script

[analyze]
parameter: par=5
output: 'out.txt'

print(f'Analyze data with parameter {par}')
with open(_output, 'w') as out:
    out.write(f'Result from parameter {par}')

[summarize]
input: 'out.txt'    
print(f'Writing report with input out.txt')
report: input='out.txt', output='out.md'
    ## A summary report

[clean]
sh:
   echo Cleaning up
   rm -f out.txt out.md

with command

$ sos run test2 clean+summarize --par 20

generate this

INFO: Running clean:
INFO: Running summarize:
Writing report with input out.txt
Cleaning up
INFO: Workflow clean+summarize (ID=95ee5d7541554ad8) is executed successfully with 2 completed steps.

or

INFO: Running clean:
INFO: Running analyze:
Cleaning up
Analyze data with parameter 20
INFO: output:   out.txt
ERROR: [analyze (out.txt)]: Output target out.txt does not exist after the completion of step analyze
[clean+summarize]: 1 pending step: summarize

So basically the clean step is executed in parallel to the summarize workflow, and removes out.txt at an undetermined time.

Perhaps we should handle

clean+summarize

as

sos run clean
sos run summarize

instead of a single workflow with two parts.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 31, 2019

The minimal test case is

[A]

[B]
input: None

and command

sos run test A+B

What is happening here is that step B is appended after A similar to a numerically indexed workflow, and then executed in parallel because of the input: None statement.

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