Skip to content

Commit

Permalink
hotfix #127
Browse files Browse the repository at this point in the history
proper handling of array size < nthreads
  • Loading branch information
MatthewRHermes committed Nov 13, 2024
1 parent 01c24c4 commit 2274fa1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions my_pyscf/lassi/op_o1/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def get_contig_blks (mask):

def split_contig_array (arrlen, nthreads):
'''Divide a contiguous array into chunks to be handled by each thread'''
nthreads = min (arrlen, nthreads)
blklen, rem = divmod (arrlen, nthreads);
blklen = np.array ([blklen,]*nthreads)
blklen[:rem] += 1
Expand Down

0 comments on commit 2274fa1

Please sign in to comment.