Skip to content

Commit

Permalink
Use base class realization checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Fanebust Dregi authored and markusdregi committed Nov 19, 2018
1 parent 3f3883d commit d76a796
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions python/python/ert_gui/simulation/models/ensemble_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,21 @@ def runSimulations__(self, arguments, run_msg):
run_context = self.create_context( arguments )
self.setPhase(0, "Running simulations...", indeterminate=False)

active_realizations = self.count_active_realizations( run_context )
self.setPhaseName("Pre processing...", indeterminate=True)
self.ert().getEnkfSimulationRunner().createRunPath( run_context )
self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.PRE_SIMULATION )

self.setPhaseName( run_msg, indeterminate=False)

num_successful_realizations = self.ert().getEnkfSimulationRunner().runEnsembleExperiment(self._job_queue, run_context)
self.assertHaveSufficientRealizations(num_successful_realizations, active_realizations )
self.checkHaveSufficientRealizations(num_successful_realizations)

self.setPhaseName("Post processing...", indeterminate=True)
self.ert().getEnkfSimulationRunner().runWorkflows( HookRuntime.POST_SIMULATION )
self.setPhase(1, "Simulations completed.") # done...
self._job_queue = None


def assertHaveSufficientRealizations(self, num_successful_realizations, active_realizations):
if num_successful_realizations == 0:
raise ErtRunError("Simulation failed! All realizations failed!")
elif (num_successful_realizations < active_realizations):
raise ErtRunError("Too many simulations have failed! .\n\n"
"Check ERT log file '%s' or simulation folder for details." % ResLog.getFilename())

def runSimulations(self, arguments ):
self.runSimulations__( arguments , "Running ensemble experiment...")

Expand Down

0 comments on commit d76a796

Please sign in to comment.