def submit( self , data_file): """ Will submit a new simulation of case given by @data_file. The return value is a Job instance from the ert.job_queue.queue.job module which can be used to query the status of the job while it is running. """ (path_base , ext) = os.path.splitext( data_file ) (run_path , base) = os.path.split( path_base ) argv = [ self.ecl_version , path_base , "%s" % ecl_util.get_num_cpu( data_file )] return JobQueue.submit( self , self.ecl_cmd , run_path , base , argv)
def run( self , ecl_cmd = None, ecl_version = None, driver = None , driver_type = None, driver_options = None, blocking = False ): """ Will start an ECLIPSE simulation of the current case. The method has a long and nasty argument list, but all arguments have sensible defaults, and you probably do not need to enter any at all. The arguments are as follows: ecl_cmd: The command used to run ECLIPSE. This will typically be a script of some kind. The command will be called with three commandline arguments: version datafile num_cpu ecl_version: The eclipse version you want to use, this should be a string of the type "2010.2". driver: This should be an instance of Driver() from ert.job_queue.driver. If driver is None the method will create a new driver instance. driver_type: If the driver is none the method will create a new driver instance, it will create a driver of this type (i.e. LOCAL, LSF or RSH). driver_options: When creating a new driver, these options will be used. blocking: If blocking is True the method will not return before the simulation is complete, otherwise the method will return immediately. If blocking is False the ECLIPSE simulation will continue even if the python script exits. Observe that there are some dependencies between the arguments: * If both driver and driver_type are present the existing driver instance will be used, and the driver_type argument will be ignored. * The driver_options argument will only be used when creating a new driver instance, and will not be used to modify an existing driver instance. This method will immediately start/submit an ECLIPSE simulation of the current case. If you have many simulations you might want use an EclQueue() and the submit() method instead, in particular if you are running locally. """ import ert.job_queue.driver as queue_driver num_cpu = ecl_util.get_num_cpu( self.datafile ) argv = [ecl_version , self.datafile , num_cpu] if ecl_cmd is None: ecl_cmd = ecl_default.default.ecl_cmd if driver_type is None: driver_type = ecl_default.default.driver_type if ecl_version is None: ecl_version = ecl_default.default.ecl_version if driver is None: if driver_options is None: driver_options = ecl_default.default.driver_options[ driver_type ] driver = queue_driver.Driver( driver_type , max_running = 0 , options = driver_options ) job = driver.submit( self.base , ecl_cmd , self.path , argv , blocking = blocking) return job
def run(self, ecl_cmd=None, ecl_version=None, driver=None, driver_type=None, driver_options=None, blocking=False): """ Will start an ECLIPSE simulation of the current case. The method has a long and nasty argument list, but all arguments have sensible defaults, and you probably do not need to enter any at all. The arguments are as follows: ecl_cmd: The command used to run ECLIPSE. This will typically be a script of some kind. The command will be called with three commandline arguments: version datafile num_cpu ecl_version: The eclipse version you want to use, this should be a string of the type "2010.2". driver: This should be an instance of Driver() from ert.job_queue.driver. If driver is None the method will create a new driver instance. driver_type: If the driver is none the method will create a new driver instance, it will create a driver of this type (i.e. LOCAL, LSF or RSH). driver_options: When creating a new driver, these options will be used. blocking: If blocking is True the method will not return before the simulation is complete, otherwise the method will return immediately. If blocking is False the ECLIPSE simulation will continue even if the python script exits. Observe that there are some dependencies between the arguments: * If both driver and driver_type are present the existing driver instance will be used, and the driver_type argument will be ignored. * The driver_options argument will only be used when creating a new driver instance, and will not be used to modify an existing driver instance. This method will immediately start/submit an ECLIPSE simulation of the current case. If you have many simulations you might want use an EclQueue() and the submit() method instead, in particular if you are running locally. """ import ert.job_queue.driver as queue_driver num_cpu = ecl_util.get_num_cpu(self.datafile) argv = [ecl_version, self.datafile, num_cpu] if ecl_cmd is None: ecl_cmd = ecl_default.default.ecl_cmd if driver_type is None: driver_type = ecl_default.default.driver_type if ecl_version is None: ecl_version = ecl_default.default.ecl_version if driver is None: if driver_options is None: driver_options = ecl_default.default.driver_options[ driver_type] driver = queue_driver.Driver(driver_type, max_running=0, options=driver_options) job = driver.submit(self.base, ecl_cmd, self.path, argv, blocking=blocking) return job