Exemple #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
Exemple #2
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
Exemple #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)
Exemple #4
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)
Exemple #5
0
 def typeName(self):
     return EclUtil.type_name(self.getEclType())
Exemple #6
0
 def typeName(self):
     return EclUtil.type_name(self.ecl_type)
Exemple #7
0
 def typeName(self):
     return EclUtil.type_name( self.getEclType( ))
Exemple #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")
Exemple #9
0
 def test_file_type(self):
     file_type, fmt, report = EclUtil.inspectExtension("CASE.X0078")
     self.assertEqual(file_type, EclFileEnum.ECL_RESTART_FILE)
Exemple #10
0
 def type_name( self ):
     return EclUtil.type_name( self.ecl_type )
Exemple #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")
Exemple #12
0
 def test_file_type(self):
     file_type , fmt , report = EclUtil.inspectExtension("CASE.X0078")
     self.assertEqual( file_type , EclFileEnum.ECL_RESTART_FILE )