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 sleep argument to submit_new_batch and fix verbose #20

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

t-reents
Copy link
Collaborator

@t-reents t-reents commented Mar 6, 2024

Hi @mbercx!

This PR contains a few small commits. Since they are all very small, I decided to combine them in a single PR.

  1. I removed the language version in the black pre-commit hook. To the best of my knowledge, this is not really necessary and caused problems when developing in an environment with python 3.10. Please correct me if I'm wrong, so that I can revert this change. (In general, the .pre-commit-config.yaml might need to be revisited anyway, as some versions are quite old. Same for the pyproject.toml, e.g. do we want to support aiida 1.0?)

  2. I added an optional sleep argument to enable a possible delay. In the current version, the delay is only used after a successful submission. This closes ✨ NEW: Add a sleep argument to submit_new_batch #11

  3. When using the BaseSubmissionController and setting verbose=True, an error is raised, as the total number of submissions is determined based on the number of nodes in the parent_group, which is a FromGroupSubmissionController property only. To fix this, the number of submissions is now determined by the length of all_extras_to_submit, which shouldn't change the logic, as the nodes in the parent_group are also identified by a unique set of extras.

The `submit_new_batch` method fails if `verbose` is set to `True`, as it
refers to the `parent_group` to get the total number of submissions.
When using the `BaseSubmissionController`, this attribute is not
specified.
To fix the `verbose` option for the `BaseSubmissionController` and
`FromGroupSubmissionController`, the number of submissions is
defined by the number of `all extras to `submit`.
Currently, the number of submitted `WorkChain`s is determined by the number of available slots.
This is not the expected behavior, as this number might be unequal to 0,
causing a logging message that states that `n` `WorkChain`s have been submitted,
even though no processes were left.
@t-reents
Copy link
Collaborator Author

I just encountered another small bug when setting verbose = True. The logging message concerning the number of submitted WorkChains wasn't correctly defined. I fixed it in the last commit.

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.

✨ NEW: Add a sleep argument to submit_new_batch
1 participant