Skip to content

Commit

Permalink
fixed bug in --forced_gpu option
Browse files Browse the repository at this point in the history
  • Loading branch information
gnovis committed Nov 14, 2016
1 parent c3b2d77 commit 128ab23
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ def run_task(gpu_info_file, args):
if not is_waiting:
is_waiting = True
print("Scheduler (PID: {}) is waiting for GPU {}.".format(os.getpid(), args.forced_gpu))
unlock_file(gpu_info_file)
time.sleep(1)
continue

# select required count of free gpu, which will be passed to the task
Expand Down Expand Up @@ -138,7 +136,8 @@ def run_task(gpu_info_file, args):
# make sure the GPU is released even on interrupts
finally:
set_free_gpu(gpu_info_file, free_gpu)

unlock_file(gpu_info_file)
time.sleep(1)
else:
unlock_file(gpu_info_file)
time.sleep(SEC_DELAY)
Expand Down

0 comments on commit 128ab23

Please sign in to comment.