-
Notifications
You must be signed in to change notification settings - Fork 110
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
Address high CPU usage for some (GUI) simulations #541
Address high CPU usage for some (GUI) simulations #541
Conversation
7e3f020
to
6f0748b
Compare
2c51e53
to
0b598a4
Compare
fc7d01c
to
6aaee2e
Compare
ert_shared/tracker/utils.py
Outdated
|
||
def _scale(nr_realisations, min_time=5, max_time=15, min_real=1, max_real=500): | ||
nr_realisations = min(max_real, nr_realisations) | ||
nr_realisations = max(min_real, nr_realisations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not quite get what these two assignments does... ? or - at least the second one always overwrite the first one - guess that should not be the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oyvindeide wanna chime in? =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, got the explanation which gave sense ... just didn't catch it initially when reading the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late to the party (and just adding this in case it improves readability), but is the equivalent of np.clip(number, min_real, max_real)
, or max(min_real, min(number, max_real))
, the point is to have a hard upper and lower boundary so that we normalize to 0-1 later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I understand - and it makes sense... just me reading through a bit fast and didn't really got the sense of what's going on. One could probably make this obvious by having
def clamp(nr_realisations, max_real, min_real):
clamped = min(max_real, nr_realisations)
clamped = max(min_real, clamped)
return clamped
but - guess that is smak & behag
I'm ready to approve, but I think this PR is quite big and it would have been nice having another pair of eyes running through as well. |
ert_gui/simulation/run_dialog.py
Outdated
@@ -2,7 +2,7 @@ | |||
import sys | |||
|
|||
try: | |||
from PyQt4.QtCore import Qt, QTimer, QSize | |||
from PyQt4.QtCore import Qt, QTimer, QSize, pyqtSignal, pyqtSlot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When touching this, could we switch to ErtQt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good to me 🥇
Could you make the TODO
into an issue as well as another issue on enabling black for the tracker
module?
6aaee2e
to
8c98903
Compare
Splits *UI rendering into three parts: ticker, progress and details. Each has its own interval at which it renders, which is scaled based on the number of realizations. A simulation tracker has been implemented, and it now controls the flow of information to both the GUI and CLI monitoring through events.
8c98903
to
8ed2b5e
Compare
Issue
Resolves #380
Approach
Splits *UI rendering into three parts: ticker, progress and details.
Each has its own interval at which it renders, which is scaled based on
the number of realizations.
A simulation tracker has been implemented, and it now controls the flow
of information to both the GUI and CLI monitoring through events.