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 authored and dafeda committed May 30, 2023
1 parent fab6038 commit 74e63f6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/ert/analysis/_es_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from dataclasses import dataclass, field
from math import sqrt
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Callable
import time

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

progress_callback(Progress(Task("Loading data", 1, 3), None))
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 @@ -434,8 +439,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 @@ -452,6 +458,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 @@ -571,9 +580,13 @@ def analysis_ES(
_save_to_temporary_storage(temp_storage, [parameter], A)

progress_callback(Progress(Task("Storing data", 3, 3), None))
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 74e63f6

Please sign in to comment.