Skip to content

Open large SCRIP grids lazily in every tool, not just subset_bbox - #152

Merged
rajeeja merged 1 commit into
mainfrom
rajeeja/scrip-lazy-open-all-grid-reads
Sep 20, 2026
Merged

rajeeja merged 1 commit into
mainfrom
rajeeja/scrip-lazy-open-all-grid-reads

Conversation

@rajeeja

@rajeeja rajeeja commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Follows #149.

Overview

Only remote_subset_bbox_plot passed chunks=, so inspect_mesh, calculate_area, plot_mesh and grid_facts still opened a 63 GB np4 SCRIP grid eagerly and died on the worker — inspect_mesh is the call that actually failed. The size guard and chunks="auto" are now inlined in all five; this module cannot share helpers, since Globus Compute ships each function body and closures over module-level helpers do not survive serialization.

Five hand-copies is what test_worker_payload_drift.py exists for, so it gains two checks: every copy refuses at the same threshold, and any function carrying the guard passes **open_kwargs to open_grid. The second matters because the guard only estimates and refuses — chunks= is what keeps the file in memory, so dropping it while keeping the refusal would OOM on every file under the threshold while looking guarded. Both were verified to fail when the copies are made to disagree.

Needs UXARRAY/uxarray#1775 on the worker to have any effect; the remap paths keep their eager opens deliberately, since weight generation materializes the grid anyway.

Only remote_subset_bbox_plot passed chunks=, so inspect_mesh,
calculate_area, plot_mesh and grid_facts still opened a 63 GB np4 SCRIP
grid eagerly and died on the worker -- inspect_mesh is the call that
actually failed. Inline the same size guard and chunks="auto" in all
five, since this module cannot share helpers: Globus Compute ships each
function body and closures over module-level helpers do not survive
serialization.

Five hand-copies is what test_worker_payload_drift.py exists for, so add
two checks to it: every copy refuses at the same threshold, and any
function carrying the guard passes **open_kwargs to open_grid. The
second matters because the guard only estimates and refuses; chunks= is
what keeps the file in memory, and dropping it while keeping the
refusal would OOM on every file under the threshold while looking
guarded. Both verified to fail when the copies are made to disagree.

The remap paths keep their eager opens: weight generation materializes
the grid anyway and that path is not tested here.
@rajeeja
rajeeja merged commit c02226c into main Sep 20, 2026
12 checks passed
@rajeeja
rajeeja deleted the rajeeja/scrip-lazy-open-all-grid-reads branch September 20, 2026 04:19
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