Skip to content

Commit 7d0787a

Browse files
committed
Avoid empty blocks
1 parent 5f245f9 commit 7d0787a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

simpeg/dask/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,8 @@ def get_parallel_blocks(
7777
flatten_blocks += block
7878

7979
chunks = np.array_split(np.arange(len(flatten_blocks)), cpu_count())
80-
return [[flatten_blocks[i] for i in chunk] for chunk in chunks]
80+
return [
81+
[flatten_blocks[i] for i in chunk] for chunk in chunks if len(chunk) > 0
82+
]
83+
8184
return blocks

0 commit comments

Comments
 (0)