# FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> # for more details. import ctypes import os.path import libjob_queue from job import Job from ert.cwrap.cwrap import * from ert.cwrap.cclass import CClass from ert.cwrap.cenum import create_enum # job_driver_type defintion from queue_driver.h create_enum(libjob_queue.lib, "queue_driver_type_enum_iget", "queue_driver_enum", globals()) class Driver(CClass): def __init__(self, type, max_running=1, options=None): """ Creates a new driver instance """ c_ptr = cfunc.alloc_driver(type) self.init_cobj(c_ptr, cfunc.free_driver) if options: for (key, value) in options: self.set_option(key, value) self.set_max_running(max_running) def set_option(self, option, value):
This module does not contain any class definitions; it mostly consists of enum definitions/values from ecl_util.h; the enum values are extracted from the shared library using the ert.cwrap.cenum.create_enum() function in a semi-automagic manner. In addition to the enum definitions there are a few stateless functions from ecl_util.c which are not bound to any class type. """ from ert.cwrap.cwrap import * from ert.cwrap.cenum import create_enum from ert.util.ctime import ctime import libecl # ecl_file_enum from ecl_util.h create_enum(libecl.lib, "ecl_util_file_enum_iget", "ecl_file_enum", globals()) # ecl_phase_enum from ecl_util.h create_enum(libecl.lib, "ecl_util_phase_enum_iget", "ecl_phase_enum", name_space=globals()) # ecl_type_enum defintion from ecl_util.h create_enum(libecl.lib, "ecl_util_type_enum_iget", "ecl_type_enum", name_space=globals()) def get_num_cpu(datafile):
# See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> # for more details. import ctypes import os.path import libjob_queue from job import Job from ert.cwrap.cwrap import * from ert.cwrap.cclass import CClass from ert.cwrap.cenum import create_enum # job_driver_type defintion from queue_driver.h create_enum( libjob_queue.lib , "queue_driver_type_enum_iget" , "queue_driver_enum" , globals()) class Driver(CClass): def __init__( self , type , max_running = 1 , options = None): """ Creates a new driver instance """ c_ptr = cfunc.alloc_driver( type ) self.init_cobj( c_ptr , cfunc.free_driver ) if options: for (key,value) in options: self.set_option( key , value ) self.set_max_running( max_running ) def set_option(self , option , value):
# Copyright (C) 2012 Statoil ASA, Norway. # # The file 'enkf_enum.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ERT is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> # for more details. from ert.cwrap.cenum import create_enum from ert.enkf import ENKF_LIB EnkfStateEnum = create_enum(ENKF_LIB, "enkf_state_enum_iget", "enkf_state_enum") EnkfRunEnum = create_enum(ENKF_LIB, "enkf_run_enum_iget", "enkf_run_enum")
of enum definitions/values from ecl_util.h; the enum values are extracted from the shared library using the ert.cwrap.cenum.create_enum() function in a semi-automagic manner. In addition to the enum definitions there are a few stateless functions from ecl_util.c which are not bound to any class type. """ from ert.cwrap.cwrap import * from ert.cwrap.cenum import create_enum from ert.util.ctime import ctime import libecl # ecl_file_enum from ecl_util.h create_enum( libecl.lib , "ecl_util_file_enum_iget" , "ecl_file_enum" , globals()) # ecl_phase_enum from ecl_util.h create_enum( libecl.lib , "ecl_util_phase_enum_iget" , "ecl_phase_enum" , name_space = globals()) # ecl_type_enum defintion from ecl_util.h create_enum( libecl.lib , "ecl_util_type_enum_iget" , "ecl_type_enum" , name_space = globals()) # ecl_file_flag_type defintion from ecl_file.h create_enum( libecl.lib , "ecl_util_file_flags_enum_iget" , "ecl_file_flag_enum" , name_space = globals()) def get_num_cpu( datafile ): """ Parse ECLIPSE datafile and determine how many CPUs are needed.
# Copyright (C) 2012 Statoil ASA, Norway. # # The file 'config.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ERT is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> # for more details. import libconfig from ert.cwrap.cenum import create_enum # config_item_types from config_schema_item.h create_enum( libconfig.lib , "config_schema_item_type_enum_iget" , "config_types_enum" , globals()) # config_item_types from config_schema_item.h create_enum( libconfig.lib , "config_schema_item_unrecognized_enum_iget" , "config_unrecognized_enum" , name_space = globals())
# Copyright (C) 2012 Statoil ASA, Norway. # # The file 'enkf_enum.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ERT is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> # for more details. from ert.cwrap.cenum import create_enum import libenkf name_space = globals() name_space["enkf_state_enum"] = create_enum(libenkf.lib, "enkf_state_enum_iget", "enkf_state_enum") name_space["enkf_run_enum"] = create_enum(libenkf.lib, "enkf_run_enum_iget", "enkf_run_enum")
# Copyright (C) 2012 Statoil ASA, Norway. # # The file 'enkf_enum.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ERT is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. # # See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> # for more details. from ert.cwrap.cenum import create_enum import libenkf name_space = globals() name_space["enkf_state_enum"] = create_enum( libenkf.lib , "enkf_state_enum_iget" , "enkf_state_enum") name_space["enkf_run_enum"] = create_enum( libenkf.lib , "enkf_run_enum_iget" , "enkf_run_enum")