How much memory does a three-dimensional supercell grid require?
Raw grid memory equals the number of cells times the number of stored fields times bytes per field value. Model overhead adds to that estimate.
Start with How soon can a supercell interact with a simulation boundary?.
| Grid | Fields | Raw memory |
|---|---|---|
| 100×100×50 | 10 float32 | 20,000,000 bytes |
| 200×200×50 | 10 float32 | 80,000,000 bytes |
Set up the experiment
Keep ten float32 fields with four bytes each on a 100×100×50 grid. Predict how memory will change if the horizontal grid dimensions both double. The original grid has 500,000 cells, giving 20,000,000 bytes or 19.1 MiB. This excludes halos, auxiliary arrays, extra time levels and output buffers.
Practice questions
- Keep the original grid and use float64 fields.
- Double all three original dimensions.
- Keep ten fields in two time levels simultaneously.
Worked answers
Answer 1
Eight bytes per value doubles the raw memory to 40,000,000 bytes.
Answer 2
Eight times as many cells require 160,000,000 bytes for the same fields.
Answer 3
The field data total 40,000,000 bytes before overhead.
- Eight bytes per value doubles the raw memory to 40,000,000 bytes.
- Eight times as many cells require 160,000,000 bytes for the same fields.
- The field data total 40,000,000 bytes before overhead.