Skip to content

Commit bbd0885

Browse files
committed
Cap max number of derivatives to 32 on GPUs
1 parent 1d03372 commit bbd0885

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/prognostic_equations/implicit/auto_sparse_jacobian.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ function jacobian_cache(
282282
# max_memory is too small to fit any εs, try using one ε per partition.
283283
# TODO: Replace the fields in I_matrix_partitions with column fields,
284284
# making memory_for_I_matrix negligible compared to max_memory.
285-
n_εs_max = (max_memory - memory_for_I_matrix) ÷ memory_per_ε - 1
285+
n_εs_max =
286+
min(32, (max_memory - memory_for_I_matrix) ÷ memory_per_ε - 1)
286287
cld(n_colors, max(n_εs_max, 1))
287288
end
288289
n_εs = cld(n_colors, n_partitions)

0 commit comments

Comments
 (0)