From 6b63c80ad7ebfe94554d7ce22c992e9d71a95de8 Mon Sep 17 00:00:00 2001 From: Yong Hoon Lee Date: Thu, 21 Nov 2024 09:58:38 -0600 Subject: [PATCH] surrogate model training logic modified --- weis/glue_code/runWEIS.py | 2 +- weis/surrogate/WTsurrogate.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/weis/glue_code/runWEIS.py b/weis/glue_code/runWEIS.py index b8436c6fa..826d480b1 100644 --- a/weis/glue_code/runWEIS.py +++ b/weis/glue_code/runWEIS.py @@ -288,7 +288,7 @@ def run_weis(fname_wt_input, fname_modeling_options, fname_opt_options, geometry # If design_of_experiment, recorder flag, train_surrogate_model are all True, # collect sql files and create smt object - if opt_options['opt_flag'] and (not SKIP_DRIVER) and (not SKIP_SMT): + if opt_options['opt_flag'] and (not SKIP_SMT): if opt_options['driver']['design_of_experiments']['flag'] and opt_options['recorder']['flag']: if opt_options['driver']['design_of_experiments']['train_surrogate_model']: WTSM = WindTurbineDOE2SM() diff --git a/weis/surrogate/WTsurrogate.py b/weis/surrogate/WTsurrogate.py index 53c0f6577..6e2ac5e5a 100644 --- a/weis/surrogate/WTsurrogate.py +++ b/weis/surrogate/WTsurrogate.py @@ -24,6 +24,7 @@ def read_doe(self, sql_file, modeling_options, opt_options): rank = 0 cr = om.CaseReader(sql_file) + print('reading cases from {:}'.format(sql_file)) cases = cr.list_cases('driver') if (not MPI) or (MPI and rank == 0): @@ -413,6 +414,7 @@ def write_sm(self, sm_filename): try: with open(sm_filename, 'wb') as fid: pkl.dump(self.dataset_list, fid, protocol=5) + print('Surrogate model written in {:}'.format(sm_filename)) except: print('Unable to write surrogate model file: {:}.'.format(sm_filename)) raise Exception('Unable to write surrogate model file: {:}.'.format(sm_filename))