Skip to content

Commit

Permalink
Support more than 100 workers
Browse files Browse the repository at this point in the history
  • Loading branch information
ranaldmiao committed Jun 25, 2021
1 parent 24dd787 commit b88fb86
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cms/grading/Sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,14 @@ def __init__(self, file_cacher, name=None, temp_dir=None):
# sequentially, with a wrap-around.
# FIXME This is the only use of FileCacher.service, and it's an
# improper use! Avoid it!

# IOI 2021 Hack for more than 100 workers:
# shard 0 = 10 - 19
# shard 98 = 990 - 999
# shard 99 = shard 0

if file_cacher is not None and file_cacher.service is not None:
box_id = ((file_cacher.service.shard + 1) * 10
box_id = (((file_cacher.service.shard % 99) + 1) * 10
+ (IsolateSandbox.next_id % 10)) % 1000
else:
box_id = IsolateSandbox.next_id % 10
Expand Down

0 comments on commit b88fb86

Please sign in to comment.