Skip to content

Commit

Permalink
rm stuff we dont need
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Jan 4, 2024
1 parent b091563 commit 8b854cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/ert/scheduler/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ async def _submit_and_run_once(self, sem: asyncio.BoundedSemaphore) -> None:
try:
await self._scheduler.submit_sleep_state.sleep_until_we_can_submit()

Check failure on line 95 in src/ert/scheduler/job.py

View workflow job for this annotation

GitHub Actions / type-checking (3.11)

Call to untyped function "sleep_until_we_can_submit" in typed context
await self._send(State.SUBMITTING)

await self.driver.submit(
self.real.iens, self.real.job_script, cwd=self.real.run_arg.runpath
)
Expand Down Expand Up @@ -148,6 +147,7 @@ async def __call__(
) -> None:
self._requested_max_submit = max_submit
await start.wait()

for attempt in range(max_submit):
await self._submit_and_run_once(sem)

Expand Down
11 changes: 3 additions & 8 deletions src/ert/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,14 @@ async def execute(
)
cancel_when_execute_is_done(self._update_avg_job_runtime())

start_events: MutableMapping[int, asyncio.Event] = {}
start = asyncio.Event()
sem = asyncio.BoundedSemaphore(self._max_running or len(self._jobs))
for iens, job in self._jobs.items():
start_events[iens] = asyncio.Event()
self._tasks[iens] = asyncio.create_task(
job(start_events[iens], sem, self._max_submit)
job(start, sem, self._max_submit)
)

async def _set_start_event(iens: int, sleep_time: float) -> None:
start_events[iens].set()

for _, iens in enumerate(self._jobs.keys()):
asyncio.create_task(_set_start_event(iens, 0))
start.set()

for task in self._tasks.values():
await task
Expand Down

0 comments on commit 8b854cc

Please sign in to comment.