def _initializeRealization(self, target_fs, geo_id, iens, keywords): ens_config = self.ert.ensembleConfig() for kw in ens_config.getKeylistFromVarType(EnkfVarType.PARAMETER): if not kw in keywords: config_node = ens_config[kw] data_node = EnkfNode(config_node) init_id = NodeId(0, geo_id) run_id = NodeId(0, iens) data_node.load(self._getInitializationCase(), init_id) data_node.save(target_fs, run_id) for key, values in keywords.items(): config_node = ens_config[key] data_node = EnkfNode(config_node) gen_kw = data_node.asGenKw() gen_kw.setValues(values) run_id = NodeId(0, iens) data_node.save(target_fs, run_id) target_fs.fsync() state_map = target_fs.getStateMap() state_map[iens] = RealizationStateEnum.STATE_INITIALIZED
def _initializeRealization(self, target_fs, geo_id, iens, keywords): ens_config = self.ert.ensembleConfig() for kw in ens_config.getKeylistFromVarType(EnkfVarType.PARAMETER): if not kw in keywords: config_node = ens_config[kw] data_node = EnkfNode( config_node ) init_id = NodeId(0, geo_id) run_id = NodeId(0, iens) data_node.load(self._getInitializationCase(), init_id) data_node.save(target_fs, run_id) for key, values in keywords.items(): config_node = ens_config[key] data_node = EnkfNode( config_node ) gen_kw = data_node.asGenKw() gen_kw.setValues(values) run_id = NodeId(0, iens) data_node.save(target_fs, run_id) target_fs.fsync() state_map = target_fs.getStateMap() state_map[iens] = RealizationStateEnum.STATE_INITIALIZED
while True: print("Waiting:%d Running:%d Complete:%d/%d" % (queue_manager.getNumWaiting( ), queue_manager.getNumRunning( ) , queue_manager.getNumSuccess() , queue_manager.getNumFailed( ))) if not queue_manager.isRunning( ): break time.sleep( 5 ) ens_config = ert.ensembleConfig( ) data_config = ens_config["SNAKE_OIL_OPR_DIFF"] param_config = ens_config["SNAKE_OIL_PARAM"] for iens in range(ert.getEnsembleSize( )): data_id = NodeId( realization_number = iens, report_step = 199 ) enkf_node1 = EnkfNode( data_config ) enkf_node1.load( fs , data_id ) gen_data = enkf_node1.asGenData( ) data = gen_data.getData( ) param_id = NodeId( realization_number = iens, report_step = 0 ) enkf_node2 = EnkfNode( param_config ) enkf_node2.load( fs , param_id ) gen_kw = enkf_node2.asGenKw( ) print sum(data) for v in gen_kw: print v
while True: print("Waiting:%d Running:%d Complete:%d/%d" % (queue_manager.getNumWaiting(), queue_manager.getNumRunning(), queue_manager.getNumSuccess(), queue_manager.getNumFailed())) if not queue_manager.isRunning(): break time.sleep(5) ens_config = ert.ensembleConfig() data_config = ens_config["SNAKE_OIL_OPR_DIFF"] param_config = ens_config["SNAKE_OIL_PARAM"] for iens in range(ert.getEnsembleSize()): data_id = NodeId(realization_number=iens, report_step=199) enkf_node1 = EnkfNode(data_config) enkf_node1.load(fs, data_id) gen_data = enkf_node1.asGenData() data = gen_data.getData() param_id = NodeId(realization_number=iens, report_step=0) enkf_node2 = EnkfNode(param_config) enkf_node2.load(fs, param_id) gen_kw = enkf_node2.asGenKw() print sum(data) for v in gen_kw: print v # Using the __getitem__() of GenData which was implemented # previously.