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

Improve the ProcessMonitor #636

Open
superstar54 opened this issue Oct 8, 2024 · 5 comments
Open

Improve the ProcessMonitor #636

superstar54 opened this issue Oct 8, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@superstar54
Copy link
Member

superstar54 commented Oct 8, 2024

The ProcessMonitor class monitors a process by executing callback functions at specified intervals as long as the process is alive.

We may extend it to cover other use cases, for example:

  1. Only when a process is finished, run the callback functions
  2. Only when a process changes its state, run the callback functions
  3. Only when a process changes its outputs, run the callback functions
@danielhollas
Copy link
Contributor

I believe point 1. is already implemented via the on_sealed argument.

@superstar54
Copy link
Member Author

Hi @danielhollas , Thanks very much for pointing out this. I didn't notice this because of the name of the variable callbacks, we may need to change it to on_running.

@danielhollas
Copy link
Contributor

To clarify, on_sealed callbacks are run exactly once when the process finishes (i.e. when the corresponding node in aiida DB is sealed, made readonly). Arguably the name exposes an implementation detail of AiiDA and could be named on_finished or something, but I think having a good documentation for this should suffice instead of making breaking change.

@danielhollas
Copy link
Contributor

Ah, I may have misunderstood your comment, I see what you mean now.

@superstar54
Copy link
Member Author

We may add more categories:

  • on_running, the callbacks used by now.
  • on_sealed
  • on_finished_ok
  • on_entered (for a new state)
  • on_modified

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

No branches or pull requests

2 participants