Exemple #1
0
#!/usr/bin/env python
import sys
import time 
from ert.enkf import EnKFMain
from ert.enkf.enums import ErtImplType


# This will instantiate the EnkFMain object and create a handle to
# "everything" ert related for this instance.
ert = EnKFMain( sys.argv[1] )


# Ask the EnKFMain instance how many realisations it has. Observe that
# the answer to this question is just the value of the
# NUM_REALISATIONS setting in the configuration file.
print("This instance has %d realisations" % ert.getEnsembleSize())


# Get the ensemble configuration object, and ask for all GEN_KW keys:
ens_config = ert.ensembleConfig( )
for key in ens_config.getKeylistFromImplType(ErtImplType.GEN_KW):
    config_node = ens_config[key]

    # "Downcast" to GEN_KW configuration.
    gen_kw_config = config_node.getModelConfig( )
    print("%s : %s" % (key , gen_kw_config.getKeyWords( )))

Exemple #2
0
#!/usr/bin/env python
import sys
import time 
from ert.enkf import EnKFMain, RunArg, NodeId
from ert.enkf.data import EnkfNode
from ert.job_queue import JobQueueManager

ert = EnKFMain( sys.argv[1] )
fs_manager = ert.getEnkfFsManager( )
fs = fs_manager.getCurrentFileSystem( )


# Initialize the realisations. 
for iens in range( ert.getEnsembleSize()):
    realisation = ert.getRealisation( iens )
    realisation.initialize( fs )


# Fetch out the job_queue from the SiteConfig object. In addition we
# create a JobQueueManager objects which wraps the queue. The purpose
# of this manager object is to let the queue run nonblocking in the
# background.
site_config = ert.siteConfig( )
queue_manager = JobQueueManager( site_config.getJobQueue( ) )
queue_manager.startQueue( ert.getEnsembleSize( ) , verbose = False )


# Create list of RunArg instances which hold metadata for one running
# realisation, create the directory where the simulation should run
# and submit the simulation.
path_fmt = "/tmp/run%d"
Exemple #3
0
#!/usr/bin/env python
import sys
import time
from ert.enkf import EnKFMain, RunArg, NodeId
from ert.enkf.data import EnkfNode
from ert.job_queue import JobQueueManager

ert = EnKFMain(sys.argv[1])
fs_manager = ert.getEnkfFsManager()
fs = fs_manager.getCurrentFileSystem()

# Initialize the realisations.
for iens in range(ert.getEnsembleSize()):
    realisation = ert.getRealisation(iens)
    realisation.initialize(fs)

# Fetch out the job_queue from the SiteConfig object. In addition we
# create a JobQueueManager objects which wraps the queue. The purpose
# of this manager object is to let the queue run nonblocking in the
# background.
site_config = ert.siteConfig()
queue_manager = JobQueueManager(site_config.getJobQueue())
queue_manager.startQueue(ert.getEnsembleSize(), verbose=False)

# Create list of RunArg instances which hold metadata for one running
# realisation, create the directory where the simulation should run
# and submit the simulation.
path_fmt = "/tmp/run%d"
arg_list = [
    RunArg.createEnsembleExperimentRunArg(fs, iens, path_fmt % iens)
    for iens in range(ert.getEnsembleSize())