Skip to content

Enhance memory handling (and performance to a lesser extent) in simulator modules - #164

Merged
isilber merged 4 commits into
ARM-DOE:masterfrom
isilber:optimize_lidar_radar
Sep 1, 2026
Merged

Enhance memory handling (and performance to a lesser extent) in simulator modules#164
isilber merged 4 commits into
ARM-DOE:masterfrom
isilber:optimize_lidar_radar

Conversation

@isilber

@isilber isilber commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors array broadcasting and tiling logic in both the lidar and radar moment simulation code. The main focus is to replace repeated use of np.tile with more explicit broadcasting via None indexing and np.broadcast_to, which improves efficiency and clarity. Additionally, there are minor optimizations and cleanups, such as deleting temporary lists and improving conditional logic.

Replace 9× np.tile(..., (n, m, k)) patterns with [None, :, :] broadcasting
Remove dead parameters from _allocate_strat_sub_col to reduce per-task
Dask serialization: cld_2_assigns, I_min, I_max were computed in caller
but immediately shadowed locally on each loop iteration.
Replace np.tile(..., (n_subcolumns, 1, 1)) with [None, :, :] broadcasting
in radar_moments.py and lidar_moments.py:
Replace redundant per-level np.all()==0 checks with single precomputed
active_k index array per time step. Applied to 5 worker functions
(_calculate_observables_liquid, _calculate_other_observables,
_calc_sigma_d_tot_cl, _calc_sigma_d_tot, _calc_strat_lidar_properties).
Benefits proportional to cloud sparsity.
@isilber
isilber merged commit 7975bc5 into ARM-DOE:master Sep 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant