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

Remove JobQueueManager #6452

Merged
merged 1 commit into from
Nov 3, 2023
Merged

Conversation

berland
Copy link
Contributor

@berland berland commented Oct 30, 2023

It was only a thin wrapper with no value left. Move its functionality down to the JobQueue object.

Issue
Resolves #6285

Approach
Short description of the approach

(Screenshot of new behavior in GUI if applicable)

Pre review checklist

  • Read through the code changes carefully after finishing work
  • Make sure tests pass locally (after every commit!)
  • Prepare changes in small commits for more convenient review (optional)
  • PR title captures the intent of the changes, and is fitting for release notes.
  • Updated documentation
  • Ensured that unit tests are added for all new behavior (See
    Ground Rules),
    and changes to existing code have good test coverage.

Pre merge checklist

  • Added appropriate release note label
  • Commit history is consistent and clean, in line with the contribution guidelines.

@berland berland added the release-notes:maintenance Automatically categorise as maintenance change in release notes label Oct 30, 2023
@berland berland force-pushed the remove_jobqueuemanager branch 2 times, most recently from e2034d9 to b191198 Compare October 30, 2023 21:23
@codecov-commenter
Copy link

Codecov Report

Merging #6452 (e2034d9) into main (8fff976) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head e2034d9 differs from pull request most recent head b191198. Consider uploading reports for the commit b191198 to get more accurate results

@@            Coverage Diff             @@
##             main    #6452      +/-   ##
==========================================
- Coverage   83.41%   83.36%   -0.05%     
==========================================
  Files         343      342       -1     
  Lines       20806    20769      -37     
  Branches      944      944              
==========================================
- Hits        17356    17315      -41     
- Misses       3163     3166       +3     
- Partials      287      288       +1     
Files Coverage Δ
src/ert/job_queue/__init__.py 80.55% <ø> (-0.53%) ⬇️
src/ert/job_queue/queue.py 91.13% <100.00%> (+0.15%) ⬆️
src/ert/simulator/simulation_context.py 87.82% <100.00%> (-0.11%) ⬇️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@berland berland marked this pull request as ready for review November 2, 2023 12:02
@berland berland self-assigned this Nov 2, 2023
@jonathan-eq jonathan-eq self-requested a review November 3, 2023 07:38
@@ -49,6 +49,11 @@
logger = logging.getLogger(__name__)

LONG_RUNNING_FACTOR = 1.25
"""If STOP_LONG_RUNNING is true, realizations taking more time than the average
Copy link
Contributor

Choose a reason for hiding this comment

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

Great addition!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just realized that these attribute docstrings are not standardized, and cannot be picked up by any tool.

while self.is_active() and not self.stopped:
self.launch_jobs(pool_sema)
self.launch_jobs(self._pool_sema)
Copy link
Contributor

Choose a reason for hiding this comment

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

This parameter being an instance variable; can it be moved into the launch_jobs method directly instead of passed in as a parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it can. Well spotted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, we need it to retain the possibility to set it when running from _builder/_legacy.py

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, because the execute_queue_via_websockets use the one from legacy. Got it!


def getNumPending(self) -> int:
return self._queue_manager.getNumPending()
return self._job_queue.count_status(JobStatus.PENDING) # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for all the type: ignore? Will this be fixed in a separate PR/issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are due to difficulties with integrating the typing with the C-code and the custom cwrap (not Pybind). It will go away as soon as we have thrown away the C-code..

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, great!

Copy link
Contributor

@jonathan-eq jonathan-eq left a comment

Choose a reason for hiding this comment

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

Very good, very nice!

while self.is_active() and not self.stopped:
self.launch_jobs(pool_sema)
self.launch_jobs(self._pool_sema)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, because the execute_queue_via_websockets use the one from legacy. Got it!

It was only a thin wrapper with no value left. Move
its functionality down to the JobQueue object.
@berland berland enabled auto-merge (rebase) November 3, 2023 11:10
@berland berland merged commit 39edde9 into equinor:main Nov 3, 2023
42 of 43 checks passed
@berland berland deleted the remove_jobqueuemanager branch November 8, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes:maintenance Automatically categorise as maintenance change in release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Remove JobQueueManager
3 participants