Skip to content

Commit

Permalink
Update experimenter.py
Browse files Browse the repository at this point in the history
debug experimenter
  • Loading branch information
barneydobson committed Apr 8, 2024
1 parent 3a82e42 commit 5fa0ff6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion swmmanywhere/paper/experimenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ def process_parameters(jobid: int,
nproc = nproc if nproc is not None else n_iter

# Assign jobs based on jobid
job_iter = tlz.partition_all(nproc, range(n_iter))
if n_iter % nproc != 0:
logger.warning(f"""Number of samples ({n_iter}) is not divisible by the
number of processors ({nproc}), leaving some processors
unused.""")
n = int(n_iter / nproc) + 1
else:
n = int(n_iter / nproc)

job_iter = tlz.partition_all(n, range(n_iter))
for _ in range(jobid + 1):
job_idx = next(job_iter, None)

Expand Down

0 comments on commit 5fa0ff6

Please sign in to comment.