예제 #1
0
    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.
        """
        import ert.job_queue.driver as queue_driver

        num_cpu = EclUtil.get_num_cpu(self.datafile)
        argv = [ecl_version, self.datafile, num_cpu]

        job = driver.submit(self.base,
                            ecl_cmd,
                            self.path,
                            argv,
                            blocking=blocking)
        return job
예제 #2
0
파일: ecl_case.py 프로젝트: agchitu/ert
    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.
        """
        import ert.job_queue.driver as queue_driver

        num_cpu = EclUtil.get_num_cpu( self.datafile )
        argv = [ecl_version , self.datafile , num_cpu]

        job = driver.submit( self.base , ecl_cmd , self.path , argv , blocking = blocking)
        return job
예제 #3
0
    def submitDataFile(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)

        num_cpu = EclUtil.get_num_cpu(data_file)
        argv = [self.ecl_version, path_base, "%s" % num_cpu]
        return super(EclQueue, self).submit(self.ecl_cmd, run_path, base, argv, num_cpu=num_cpu)
예제 #4
0
파일: ecl_queue.py 프로젝트: danielfmva/ert
    def submitDataFile(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)

        num_cpu = EclUtil.get_num_cpu(data_file)
        argv = [self.ecl_version, path_base, "%s" % num_cpu]
        return super(EclQueue, self).submit(self.ecl_cmd,
                                            run_path,
                                            base,
                                            argv,
                                            num_cpu=num_cpu)
예제 #5
0
 def typeName(self):
     return EclUtil.type_name(self.getEclType())
예제 #6
0
 def typeName(self):
     return EclUtil.type_name(self.ecl_type)
예제 #7
0
파일: ecl_kw.py 프로젝트: jokva/ert
 def typeName(self):
     return EclUtil.type_name( self.getEclType( ))
예제 #8
0
    def test_file_report_nr(self):
        report_nr = EclUtil.reportStep("CASE.X0080")
        self.assertEqual(report_nr, 80)

        with self.assertRaises(ValueError):
            EclUtil.reportStep("CASE.EGRID")
예제 #9
0
 def test_file_type(self):
     file_type, fmt, report = EclUtil.inspectExtension("CASE.X0078")
     self.assertEqual(file_type, EclFileEnum.ECL_RESTART_FILE)
예제 #10
0
파일: ecl_kw.py 프로젝트: blattms/ert
 def type_name( self ):
     return EclUtil.type_name( self.ecl_type )
예제 #11
0
    def test_file_report_nr(self):
        report_nr = EclUtil.reportStep("CASE.X0080")
        self.assertEqual( report_nr , 80 )

        with self.assertRaises(ValueError):
            EclUtil.reportStep("CASE.EGRID")
예제 #12
0
 def test_file_type(self):
     file_type , fmt , report = EclUtil.inspectExtension("CASE.X0078")
     self.assertEqual( file_type , EclFileEnum.ECL_RESTART_FILE )