Skip to content

Commit

Permalink
debug: MORE...
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Dec 9, 2024
1 parent 925d912 commit 981eb2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion neps/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def _get_next_trial(self) -> Trial | Literal["break"]:
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")
f.write(f"locked: {time.time()}\n")

trials = self.state._trials.latest()

Expand Down Expand Up @@ -396,6 +396,8 @@ def _get_next_trial(self) -> Trial | Literal["break"]:
)
return earliest_pending
logger.info("I, MR WORKER %s released thel lock", self.worker_id)
with DEBUG_COUNT_FILE.open("a") as f:
f.write(f"unlocked: {time.time()}\n")

# NOTE: It's important to release the trial lock before sampling
# as otherwise, any other service, such as reporting the result
Expand Down

0 comments on commit 981eb2d

Please sign in to comment.