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

Flagging Operations as "submit only" #33

Closed
csadorf opened this issue Aug 21, 2018 · 14 comments
Closed

Flagging Operations as "submit only" #33

csadorf opened this issue Aug 21, 2018 · 14 comments
Labels
enhancement New feature or request groups
Milestone

Comments

@csadorf
Copy link
Contributor

csadorf commented Aug 21, 2018

Original report by RoseCers (Bitbucket: RoseCers, ).


I'd like a command line functionality to be added such that I can say "python project.py run -o all_not_for_submit --progress --parallel" so that I can run all quick aggregators without trying to run operations that should be "submit only"

@csadorf
Copy link
Contributor Author

csadorf commented Sep 6, 2018

Original comment by RoseCers (Bitbucket: RoseCers, ).


Another option is providing an "--except" flag for python project.py run, where --except denotes which operations not to run @csadorf

@csadorf
Copy link
Contributor Author

csadorf commented Dec 11, 2018

Original comment by Carl Simon Adorf (Bitbucket: csadorf, GitHub: csadorf).


Duplicate of #30.

@csadorf
Copy link
Contributor Author

csadorf commented Feb 23, 2019

This is still relevant and I think we should address this as a separate issue.

@csadorf csadorf reopened this Feb 23, 2019
@csadorf csadorf added the enhancement New feature or request label Feb 23, 2019
@csadorf csadorf added this to the v0.7 milestone Feb 23, 2019
@csadorf
Copy link
Contributor Author

csadorf commented Feb 23, 2019

@rosecers I've reopened this issue that you had created a while back.

@csadorf
Copy link
Contributor Author

csadorf commented Feb 23, 2019

I think we should have conditions that allow you to specify whether a specific operation is only eligible in certain execution contexts, such as during submission or only local runs. Here is what the API could look like:

@Project.no_submit
def only_run_or_script(job):
    pass

@Project.no_run
def only_submit_or_script(job):
    pass

@Project.no_run
@Project.no_submit
def script_only(job):
    pass

These decorators can optionally be made conditional by providing a condition function which may or may not be a function of job and an optional reason:

@Project.no_run(on_laptop, reason='do not execute locally')
@Project.no_submit(condition=lambda job: job.sp.N < 10000, reason='system size too small')
def only_submit_sometimes(job):
    pass

I am not sure how we should signal this kind of specificity in the status overview. @rosecers Thoughts?

@csadorf csadorf modified the milestones: v0.7, v0.8 Feb 26, 2019
@rosecers
Copy link
Contributor

Hey Simon, that would probably work. How would it jive with the old API?

            self.add_operation(
                            name=
                            cmd=
                            pre=[],\
                            post=[])

I really like this API and have not switched to the new one.

@csadorf
Copy link
Contributor Author

csadorf commented Feb 26, 2019

Hey Simon, that would probably work. How would it jive with the old API?

            self.add_operation(
                            name=
                            cmd=
                            pre=[],\
                            post=[])

I really like this API and have not switched to the new one.

I intend to keep that "old API" supported indefinitely, so we could probably add arguments no_run, no_submit, and no_script to the FlowProject.add_operation() function. Alternatively we could group them into some kind of execution directive.

Do you have any thoughts about how to display this as part of the status output?

@rosecers
Copy link
Contributor

rosecers commented Feb 26, 2019 via email

@csadorf
Copy link
Contributor Author

csadorf commented Feb 26, 2019

We could either separate them into columns or place flags [NR, NS, NSC] along with [I,Q,S,H,A], etc.

I think adding more columns might be problematic space-wise, but I like the idea of just adding flags.

@vyasr
Copy link
Contributor

vyasr commented Jul 5, 2019

Solving this will be much easier with #114. Once that is merged we can revisit whether or not to implement further conveniences to enable this feature.

@vyasr vyasr modified the milestones: v0.9, v1.0 Jul 5, 2019
@yuanzhou0827
Copy link
Contributor

yuanzhou0827 commented Jul 5, 2019 via email

@csadorf csadorf added the groups label Sep 6, 2019
@bdice bdice modified the milestones: v0.9.0, v0.10.0 Dec 20, 2019
@vyasr
Copy link
Contributor

vyasr commented Feb 26, 2020

@csadorf now that groups are merged, how do you propose we address this? Perhaps using a directive makes sense? Otherwise, we could do a separate decorator.

@bdice
Copy link
Member

bdice commented Feb 26, 2020

It seems to me like using the new groups feature would solve this problem. You would create a group of all the quick-running operations and run that group locally, then submit all others. I don't think there is enough reason to create an entirely new feature for this if groups will suffice.

@vyasr
Copy link
Contributor

vyasr commented Feb 26, 2020

I'm perfectly fine with that solution, it's how I would probably address it myself in the current flow and I agree that there's no need to introduce additional complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request groups
Projects
None yet
Development

No branches or pull requests

5 participants