Skip to content
Snippets Groups Projects
Commit f28239ea authored by Roberto Di Cosmo's avatar Roberto Di Cosmo
Browse files

Handle case when there are less shards than processes

parent 4aaa321e
No related branches found
No related tags found
No related merge requests found
......@@ -83,8 +83,11 @@ if PROCESSES is None:
# Upper-round the number of processes to a multiple of the number of shards,
# to evenly distribute the load
shards_per_process = len(shards) / PROCESSES
PROCESSES = int(len(shards) / math.floor(shards_per_process))
if PROCESSES > len(shards):
PROCESSES = len(shards)
else:
shards_per_process = len(shards) / PROCESSES
PROCESSES = int(len(shards) / math.floor(shards_per_process))
print(
f"Converting {len(shards)} shards from {input_dir} to "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment