Skip to content

Commit

Permalink
fix bundle index bug when specmin>0
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bailey authored and Stephen Bailey committed Jan 31, 2021
1 parent db50416 commit 6f96da9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions py/desispec/scripts/specex.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,12 @@ def main(args, comm=None):
rank = comm.rank

mynbundle = int(nbundle / nproc)
myfirstbundle = 0
leftover = nbundle % nproc
if rank < leftover:
mynbundle += 1
myfirstbundle = rank * mynbundle
myfirstbundle = bundles[0] + rank * mynbundle
else:
myfirstbundle = ((mynbundle + 1) * leftover) + \
myfirstbundle = bundles[0] + ((mynbundle + 1) * leftover) + \
(mynbundle * (rank - leftover))

if rank == 0:
Expand Down

0 comments on commit 6f96da9

Please sign in to comment.