File tree Expand file tree Collapse file tree 1 file changed +23
-17
lines changed Expand file tree Collapse file tree 1 file changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -208,26 +208,32 @@ def run(self, n_evals: Optional[int] = None) -> None:
208
208
# Save exploration parameters to json file.
209
209
self ._save_exploration_parameters ()
210
210
211
- # Launch exploration with libEnsemble.
212
- history , persis_info , flag = libE (
213
- sim_specs ,
214
- gen_specs ,
215
- exit_criteria ,
216
- persis_info ,
217
- self .alloc_specs ,
218
- self .libE_specs ,
219
- H0 = self ._libe_history .H ,
220
- )
211
+ try :
212
+ # Launch exploration with libEnsemble.
213
+ history , persis_info , flag = libE (
214
+ sim_specs ,
215
+ gen_specs ,
216
+ exit_criteria ,
217
+ persis_info ,
218
+ self .alloc_specs ,
219
+ self .libE_specs ,
220
+ H0 = self ._libe_history .H ,
221
+ )
221
222
222
- # Update history.
223
- self ._libe_history .H = history
223
+ # Update history.
224
+ self ._libe_history .H = history
224
225
225
- # Update number of evaluation in this exploration.
226
- n_evals_final = self .generator .n_evaluated_trials
227
- self ._n_evals += n_evals_final - n_evals_initial
226
+ # Update number of evaluation in this exploration.
227
+ n_evals_final = self .generator .n_evaluated_trials
228
+ self ._n_evals += n_evals_final - n_evals_initial
228
229
229
- # Reset `cwd` to initial value before `libE` was called.
230
- os .chdir (cwd )
230
+ except Exception as e :
231
+ logger .error (
232
+ "Exploration stopped due to an exception: {}" .format (e )
233
+ )
234
+ finally :
235
+ # Reset `cwd` to initial value before `libE` was called.
236
+ os .chdir (cwd )
231
237
232
238
def attach_trials (
233
239
self ,
You can’t perform that action at this time.
0 commit comments