Skip to content
VLASIFY™
CalculatorCalculators & technical tools

PIC simulation memory calculator

Updated · Scientifically reviewed by Priyank Srivastava, PhD on

Short answer

PIC memory is dominated by particles: each macro-particle stores its positions, three momentum components, a weight and possibly an ID or other attributes, which is typically 64 bytes in double precision. Total memory ≈ cells × particles per cell × species × bytes per particle, plus fields (about 9 arrays per cell for E, B and J) and buffers. Divide by the number of GPUs or nodes to check that each device has enough memory. Use the calculator below.

Who this is for

PIC users planning runs on GPUs or CPU clusters who need to know how many devices are required to fit a simulation in memory.

PIC memory calculator

Results update as you type. Scientific notation such as 1e18 is accepted.

e.g. weight + id

E, B, J = 9

PIC memory results
Macro-particles—
Particle memory—
Field memory—
Total (+30% buffers)—
Per device—

Formula

Np=Ncells×Nppc×Nspecies,Mparticles=Np (npos+3+nextra) b,N_p = N_{cells}\times N_{ppc}\times N_{species}, \qquad M_{particles} = N_p\,(n_{pos} + 3 + n_{extra})\,b, Mfields=Ncells nfields b,Mtotal≈1.3 (Mparticles+Mfields),Mdevice=Mtotal/Ndevices,M_{fields} = N_{cells}\,n_{fields}\,b, \qquad M_{total} \approx 1.3\,(M_{particles} + M_{fields}), \qquad M_{device} = M_{total}/N_{devices},

where bb is 8 bytes (double) or 4 bytes (single precision), nposn_{pos} the number of stored position components, nextran_{extra} extra attributes (weight, ID, …) and nfieldsn_{fields} the field arrays per cell (E, B, J give 9).

Worked example

A 2D laser–plasma run: 4096×10244096\times1024 cells, 16 particles per cell per species, 2 species, double precision, 3 positions + 3 momenta + 2 extra attributes, 9 field arrays.

  • Cells: 4096×1024=4.19×1064096\times1024 = 4.19\times10^{6}.
  • Particles: 4.19×106×16×2=1.34×1084.19\times10^{6}\times16\times2 = 1.34\times10^{8}.
  • Particle memory: 1.34×108×64 B=8.61.34\times10^{8}\times64\ \text{B} = 8.6 GB.
  • Field memory: 4.19×106×9×8 B=0.304.19\times10^{6}\times9\times8\ \text{B} = 0.30 GB.
  • Total with 30% margin: ≈11.6\approx 11.6 GB, which fits on one 16 GB GPU or comfortably on a 40 GB GPU.

The same run in 3D with 512 cells in the third direction would need about 512 times more, roughly 6 TB, which requires on the order of a hundred or more large-memory GPUs. This is why reduced-dimensional and quasi-cylindrical runs are so valuable.

Where it is used

  • Choosing the number of GPUs or nodes before requesting an allocation.
  • Trade-offs: fewer particles per cell, single precision, or a smaller box versus more hardware.
  • Avoiding out-of-memory failures mid-run; see CUDA out of memory.

For cell size, time step and core-hours derived from the plasma physics, use the PIC Simulation Planner.

Assumptions and limitations

  • A planning estimate. Each code has its own data layout, buffers and diagnostics memory, so measure in a short test run.
  • Spectral solvers, mesh refinement and PML layers add field memory not captured by the simple per-cell count.
  • Memory per device assumes good load balance. Non-uniform plasmas can need significantly more on some devices.

Frequently asked questions

How does this differ from the PIC Simulation Planner?+

The planner derives cell size, time step, cells and cost from the plasma physics. This calculator starts from a grid you already know and lets you set storage details (precision, stored attributes, field arrays, number of devices) to check whether the run fits in memory.

Why add 30% for buffers?+

Codes allocate guard cells, communication buffers, temporary arrays for deposition and sorting, and diagnostics. Their size depends on the code and settings; 30% is a planning margin, not a code-specific value. Measure the real usage in a short test run.

Do 2D codes store three position components?+

It depends on the code. Some store only the simulated coordinates; others keep a third coordinate or angle (for example in quasi-cylindrical codes). Momentum is usually stored in all three components. Check your code's particle attributes.

What if particle numbers grow during the run?+

Ionisation, injection with a moving window, or particle splitting increase the particle count, and load imbalance can concentrate particles on some devices. Size memory for the peak, with headroom, not for the initial state.

References

  1. WarpX documentation: memory usage and parallelization · WarpX documentation
  2. Birdsall & Langdon, Plasma Physics via Computer Simulation (CRC Press) · Standard textbook
  3. Decyk & Singh, Particle-in-cell algorithms for emerging computer architectures, Comput. Phys. Commun. 185, 708 (2014) · Peer-reviewed article

Planning a real simulation?

Estimates are the start. We design, run and verify the full simulation, with convergence checks and documented limits.

Services listed on this page are available today. Products marked “early access” or “in development” on our platform page are not yet generally available.

Spotted an error or an outdated command? Tell us. We correct verified issues promptly.

Related guides

How Vlasify can help

Get a Quote