This page lists the environment variables recognized by GridR. It is a
quick reference; for the design rationale and inner workings of the
features they control, follow the links to the dedicated topic pages.
Shared memory backend
These variables control how GridR’s chaining subsystem shares numpy
arrays between worker processes. They affect the chain pipelines under
gridr.chain only; the single-process API reads no environment variable.
GridR ships three shared-memory backends — shm, mmap and
memfd — with different trade-offs depending on the deployment
environment (Docker, /dev/shm availability, fork vs spawn). The
default behaviour is to auto-detect the most appropriate backend; the
variables below let you override this when needed.
For the full description of the backends and the auto-detection
algorithm, see gridr.scaling.shared_array.
Forces the shared-memory backend, bypassing auto-detection. Accepts
shm, mmap or memfd. Typical uses:
shm — Standard environments with a properly sized /dev/shm.
This is the historical behaviour, suitable for development
workstations.
mmap — Memory-constrained Linux containers (e.g. Docker with the
default 64 MB /dev/shm cap). No filesystem footprint; works only
with the fork multiprocessing start method.
memfd — Linux deployments planning the move to spawn workers
(Python 3.14+). Requires kernel ≥ 3.17.
Invalid values are silently ignored and auto-detection runs instead.
See gridr.scaling.shared_array for the canonical reference.
Threshold in bytes used by the shared-memory auto-detection routine.
When /dev/shm reports at least this many free bytes, the shm
backend is selected; otherwise the chain falls back to mmap or
memfd. Default: 64 MiB (67108864).
Ignored when GRIDR_SHARED_BACKEND is explicitly set.
See gridr.scaling.shared_array for the canonical reference.