From 74e63f6d6b1114d014ee8e262779addb67a6dc17 Mon Sep 17 00:00:00 2001 From: Feda Curic Date: Thu, 13 Apr 2023 14:25:00 +0200 Subject: [PATCH] Time loading and writing during update --- src/ert/analysis/_es_update.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/ert/analysis/_es_update.py b/src/ert/analysis/_es_update.py index 4a690374b88..d5e0f83208a 100644 --- a/src/ert/analysis/_es_update.py +++ b/src/ert/analysis/_es_update.py @@ -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 @@ -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( @@ -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, @@ -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 @@ -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(