Beispiel #1
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" %
              datetime.now().isoformat(sep=" "))

        num_successful_realizations = simulation_runner.runEnsembleExperiment()

        success = self.ert().analysisConfig().haveEnoughRealisations(
            num_successful_realizations,
            self.ert().getEnsembleSize())
        if not success:
            print(
                "Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!"
            )
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" %
              datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
Beispiel #2
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))

        if self.ert().getEnkfSimulationRunner().isHookPreSimulation():
            self.ert().getEnkfSimulationRunner().runHookWorkflow()

        success = simulation_runner.runEnsembleExperiment()

        if not success:
            print("Error: Simulations failed!")
            return

        if self.ert().getEnkfSimulationRunner().isHookPostSimulation():
            self.ert().getEnkfSimulationRunner().runHookWorkflow()

        print("Ensemble Experiment post processing!")
        simulation_runner.runPostHookWorkflow()

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
Beispiel #3
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()
        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))

        iteration_count = 0
        active_realization_mask = BoolVector(default_value = True, initial_size = self.ert().getEnsembleSize())
        simulation_runner.createRunPath(active_realization_mask, iteration_count)

        simulation_runner.runWorkflows(HookRuntime.PRE_SIMULATION)

        print("Start simulations!")
        num_successful_realizations = simulation_runner.runEnsembleExperiment()

        success = self.ert().analysisConfig().haveEnoughRealisations(num_successful_realizations, self.ert().getEnsembleSize())
        if not success:
            print("Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!")
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
Beispiel #4
0
    def update(self, line):
        arguments = splitArguments(line)

        if len(arguments) == 1:
            case_name = arguments[0]
            target_fs = self.ert().getEnkfFsManager().getFileSystem(case_name)
            simulation_runner = EnkfSimulationRunner(self.ert())
            success = simulation_runner.smootherUpdate(target_fs)

            if not success:
                self.lastCommandFailed("Unable to perform update")

        else:
            self.lastCommandFailed("Expected one argument: <target_fs> received: '%s'" % line)
Beispiel #5
0
    def update(self, line):
        arguments = splitArguments(line)

        if len(arguments) == 1:
            case_name = arguments[0]
            target_fs = self.ert().getEnkfFsManager().getFileSystem(case_name)
            simulation_runner = EnkfSimulationRunner(self.ert())
            success = simulation_runner.smootherUpdate(target_fs)

            if not success:
                self.lastCommandFailed("Unable to perform update")

        else:
            self.lastCommandFailed("Expected one argument: <target_fs> received: '%s'" % line)
Beispiel #6
0
    def __init__(self, model_config, site_config, strict=True):
        c_ptr = EnKFMain.cNamespace().bootstrap(site_config, model_config,
                                                strict, False)
        super(EnKFMain, self).__init__(c_ptr)

        self.__simulation_runner = EnkfSimulationRunner(self)
        self.__fs_manager = EnkfFsManager(self)
Beispiel #7
0
    def do_ensemble_experiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))
        success = simulation_runner.runEnsembleExperiment()

        if not success:
            print("Error: Simulations failed!")
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runPostWorkflow()

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
Beispiel #8
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()

        print("Ensemble Experiment started at: %s" % datetime.now().isoformat(sep=" "))

        success = simulation_runner.runEnsembleExperiment()

        if not success:
            print("Error: Simulations failed!")
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" % datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
Beispiel #9
0
    def __init__(self, model_config, strict=True):
        c_ptr = EnKFMain.cNamespace().bootstrap(model_config, strict, False)
        super(EnKFMain, self).__init__(c_ptr)

        # The model_config argument can be None; the only reason to
        # allow that possibility is to be able to test that the
        # site-config loads correctly.
        if model_config is None:
            self.__simulation_runner = None
            self.__fs_manager = None
        else:
            self.__simulation_runner = EnkfSimulationRunner(self)
            self.__fs_manager = EnkfFsManager(self)
Beispiel #10
0
    def __init__(self, model_config, strict=True, verbose=True):
        c_ptr = self._alloc(model_config, strict, verbose)
        super(EnKFMain, self).__init__(c_ptr)

        # The model_config argument can be None; the only reason to
        # allow that possibility is to be able to test that the
        # site-config loads correctly.
        if model_config is None:
            self.__simulation_runner = None
            self.__fs_manager = None
            self.__es_update = None
        else:
            self.__simulation_runner = EnkfSimulationRunner(self)
            self.__fs_manager = EnkfFsManager(self)
            self.__es_update = ESUpdate(self)

        self.__key_manager = KeyManager(self)
Beispiel #11
0
    def ensembleExperiment(self, line):
        simulation_runner = EnkfSimulationRunner(self.ert())

        now = time.time()
        print("Ensemble Experiment started at: %s" %
              datetime.now().isoformat(sep=" "))

        print("Create the run path!")
        iteration_count = self.ert().analysisConfig().getAnalysisIterConfig(
        ).getNumIterations()
        active_realization_mask = BoolVector.createActiveMask(
            "0-%d" % self.ert().getEnsembleSize())
        # Note that 0(zero) is used and not iteration_count
        simulation_runner.createRunPath(active_realization_mask, 0)

        print("Ensemble Experiment pre processing!")
        simulation_runner.runWorkflows(HookRuntime.PRE_SIMULATION)

        print("Start simulations!")
        num_successful_realizations = simulation_runner.runEnsembleExperiment()

        success = self.ert().analysisConfig().haveEnoughRealisations(
            num_successful_realizations,
            self.ert().getEnsembleSize())
        if not success:
            print(
                "Error: Number of successful realizations is too low.\nYou can allow more failed realizations by setting / changing the MIN_REALIZATIONS configuration element!"
            )
            return

        print("Ensemble Experiment post processing!")
        simulation_runner.runWorkflows(HookRuntime.POST_SIMULATION)

        print("Ensemble Experiment completed at: %s" %
              datetime.now().isoformat(sep=" "))

        diff = time.time() - now
        print("Running time: %d seconds" % int(diff))
Beispiel #12
0
    def __init__(self, model_config, strict=True, verbose=True):
        if model_config is not None and not isfile(model_config):
            raise IOError('No such configuration file "%s".' % model_config)
        c_ptr = self._alloc(model_config, strict, verbose)
        if c_ptr:
            super(EnKFMain, self).__init__(c_ptr)
        else:
            raise ValueError(
                'Failed to construct EnKFMain instance from config %s.' %
                model_config)

        # The model_config argument can be None; the only reason to
        # allow that possibility is to be able to test that the
        # site-config loads correctly.
        if model_config is None:
            self.__simulation_runner = None
            self.__fs_manager = None
            self.__es_update = None
        else:
            self.__simulation_runner = EnkfSimulationRunner(self)
            self.__fs_manager = EnkfFsManager(self)
            self.__es_update = ESUpdate(self)

        self.__key_manager = KeyManager(self)
Beispiel #13
0
 def createCReference(cls, c_pointer, parent=None):
     obj = super(EnKFMain, cls).createCReference(c_pointer, parent)
     obj.__simulation_runner = EnkfSimulationRunner(obj)
     obj.__fs_manager = EnkfFsManager(obj)
     return obj