Skip to content

Commit

Permalink
Time loading and writing during update
Browse files Browse the repository at this point in the history
  • Loading branch information
Feda Curic committed Apr 17, 2023
1 parent 5d1837e commit a4eb36e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/ert/analysis/_es_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from math import sqrt
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple
import time

import iterative_ensemble_smoother as ies
import numpy as np
Expand Down Expand Up @@ -366,9 +367,13 @@ def analysis_ES(
) -> None:
iens_active_index = [i for i in range(len(ens_mask)) if ens_mask[i]]

start = time.time()
temp_storage = _create_temporary_parameter_storage(
source_fs, ensemble_config, iens_active_index
)
end = time.time()
elapsed = end - start
print(f"Time to run _create_temporary_parameter_storage: {elapsed}")

ensemble_size = sum(ens_mask)
param_ensemble = _param_ensemble_for_projection(
Expand All @@ -379,8 +384,9 @@ def analysis_ES(
truncation = module.get_truncation()
# Looping over local analysis update_step
for update_step in updatestep:
print("Loading responses and observations...")
start = time.time()
try:
print("Loading responses and observations...")
Y, (
observation_values,
observation_errors,
Expand All @@ -397,6 +403,9 @@ def analysis_ES(
)
except IndexError as e:
raise ErtAnalysisError(e) from e
end = time.time()
elapsed = end - start
print(f"Time to run _load_observations_and_responses: {elapsed}")

# pylint: disable=unsupported-assignment-operation
smoother_snapshot.update_step_snapshots[update_step.name] = update_snapshot
Expand Down Expand Up @@ -515,9 +524,13 @@ def analysis_ES(
):
_save_to_temporary_storage(temp_storage, [parameter], A)

start = time.time()
_save_temporary_storage_to_disk(
target_fs, ensemble_config, temp_storage, iens_active_index
)
end = time.time()
elapsed = end - start
print(f"Time to run _save_temporary_storage_to_disk: {elapsed}")


def analysis_IES(
Expand Down

0 comments on commit a4eb36e

Please sign in to comment.