Skip to content

Commit

Permalink
Commitin
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeda committed Nov 13, 2024
1 parent 3fec61f commit 0366e34
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 1 deletion.
Binary file added test-data/ert/heat_equation/cond_0.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_1.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_2.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_3.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_4.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_5.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_6.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_7.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_8.bgrdecl
Binary file not shown.
Binary file added test-data/ert/heat_equation/cond_9.bgrdecl
Binary file not shown.
2 changes: 1 addition & 1 deletion test-data/ert/heat_equation/config.ert
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ QUEUE_OPTION LOCAL MAX_RUNNING 100

RANDOM_SEED 11223344

NUM_REALIZATIONS 100
NUM_REALIZATIONS 10
GRID CASE.EGRID

OBS_CONFIG observations
Expand Down
26 changes: 26 additions & 0 deletions test-data/ert/heat_equation/config_forward_init_false.ert
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- By default, NumPy utilizes multiple threads, which is beneficial for parallelizable computations.
-- However, the heat equation implementation in this case does not benefit from parallel execution within a single realization.
-- When ERT runs multiple realizations, each one by default uses multiple threads for NumPy operations,
-- leading to resource contention and slower overall execution.
-- Setting these thread counts to 1 ensures each realization uses minimal resources,
-- allowing more realizations to run concurrently and significantly speeding up the entire experiment.
SETENV MKL_NUM_THREADS 1
SETENV NUMEXPR_NUM_THREADS 1
SETENV OMP_NUM_THREADS 1

QUEUE_SYSTEM LOCAL
QUEUE_OPTION LOCAL MAX_RUNNING 100

RANDOM_SEED 11223344

NUM_REALIZATIONS 10
GRID CASE.EGRID

OBS_CONFIG observations

FIELD COND PARAMETER cond.bgrdecl INIT_FILES:cond_%d.bgrdecl FORWARD_INIT:False

GEN_DATA MY_RESPONSE RESULT_FILE:gen_data_%d.out REPORT_STEPS:10,71,132,193,255,316,377,438 INPUT_FORMAT:ASCII

INSTALL_JOB heat_equation HEAT_EQUATION
SIMULATION_JOB heat_equation <IENS> <ITER>
8 changes: 8 additions & 0 deletions test-data/ert/heat_equation/heat_equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ def sample_prior_conductivity(ensemble_size, nx, rng):
return np.exp(geostat.gaussian_fields(mesh, rng, ensemble_size, r=0.8))


# rng = np.random.default_rng()
# for i in range(10):
# cond = sample_prior_conductivity(ensemble_size=1, nx=nx, rng=rng).reshape(nx, nx)
# resfo.write(
# f"cond_{i}.bgrdecl",
# [("COND ", cond.flatten(order="F").astype(np.float32))]
# )

if __name__ == "__main__":
iens = int(sys.argv[1])
iteration = int(sys.argv[2])
Expand Down
7 changes: 7 additions & 0 deletions tests/ert/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ def copy_snake_oil_case(copy_case):
fh.write("QUEUE_OPTION LOCAL MAX_RUNNING 12\n")


@pytest.fixture()
def copy_heat_equation(copy_case):
copy_case("heat_equation")
with open("config.ert", "a", encoding="utf-8") as fh:
fh.write("QUEUE_OPTION LOCAL MAX_RUNNING 12\n")


@pytest.fixture(
name="copy_snake_oil_case_storage",
params=[
Expand Down

0 comments on commit 0366e34

Please sign in to comment.