Skip to content

Commit

Permalink
debug: Add log file
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Dec 9, 2024
1 parent b146d05 commit 56d8acc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions neps/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ def _get_next_trial(self) -> Trial | Literal["break"]:
with self.state._optimizer_lock.lock():
with self.state._trial_lock.lock():
time.sleep(self._GRACE) # Give the lock some time to
logger.info("I, MR WORKER %s obtained thel lock", self.worker_id)
DEBUG_COUNT_FILE = Path(self.state.path / "DEBUG_COUNT_FILE")
with DEBUG_COUNT_FILE.open("a") as f:
f.write(f"{self.worker_id}\n")

trials = self.state._trials.latest()

if self._requires_global_stopping_criterion:
Expand Down Expand Up @@ -407,6 +412,9 @@ def _get_next_trial(self) -> Trial | Literal["break"]:
worker_id=self.worker_id,
)
self.state._trials.new_trial(sampled_trial)
logger.info(
"I, MR WORKER %s, SAMPLED %s", self.worker_id, sampled_trial.id
)
logger.info(
"Worker '%s' sampled new trial: %s.",
self.worker_id,
Expand Down

0 comments on commit 56d8acc

Please sign in to comment.