Skip to content

Commit

Permalink
Fix in hyper_scan_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Cmurilochem committed Feb 26, 2024
1 parent 5628cba commit 4488f8d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions n3fit/src/n3fit/hyper_optimization/hyper_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ def hyper_scan_wrapper(replica_path_set, model_trainer, hyperscanner, max_evals=
# Tell the trainer we are doing hpyeropt
model_trainer.set_hyperopt(True, keys=hyperscanner.hyper_keys, status_ok=hyperopt.STATUS_OK)

if hyperscanner.parallel_hyperopt:
# start MongoDB database bu launching `mongod`
hyperscanner.mongod_runner.ensure_database_dir_exists()
mongod = hyperscanner.mongod_runner.start()

if hyperscanner.restart_hyperopt:
# For parallel hyperopt restarts, extract the database tar file
if hyperscanner.parallel_hyperopt:
Expand All @@ -135,6 +130,11 @@ def hyper_scan_wrapper(replica_path_set, model_trainer, hyperscanner, max_evals=
log.info("Restarting hyperopt run using the pickle file %s", pickle_file_to_load)
trials = FileTrials.from_pkl(pickle_file_to_load)

if hyperscanner.parallel_hyperopt:
# start MongoDB database by launching `mongod`
hyperscanner.mongod_runner.ensure_database_dir_exists()
mongod = hyperscanner.mongod_runner.start()

# Generate the trials object
if hyperscanner.parallel_hyperopt:
# Instantiate `MongoFileTrials`
Expand Down

0 comments on commit 4488f8d

Please sign in to comment.