AI Glossary / Data engineering and architecture / Intermediate
Distributed memory
Definition
Distributed memory is a computer architecture or programming model in which processing units work with separate local memories and communicate to exchange needed data. In the usual message-passing model, a process cannot treat another process's ordinary local variables as its own directly accessible memory.
What it means
A cluster may have substantial total memory without offering one ordinary address space containing all of it. A program must decide which process owns each portion of its data and how other processes obtain required values.
This differs from shared-memory programming, where threads can access a common address space subject to synchronization rules. Physical layout and programming abstraction must be distinguished: software can provide a shared-memory-style abstraction over distributed hardware, and message-passing programs can run within a shared-memory machine.
Many practical systems are hybrid. Threads or accelerators within a node may share or transfer local data through one set of mechanisms, while nodes exchange data over a network. Saying that a machine has a certain total memory capacity therefore does not explain how a particular program can use it.
How it works
The application partitions its data and assigns work to processes. Each process performs calculations on its local portion. When the next calculation needs information held elsewhere, the program or runtime communicates that information using an appropriate mechanism.
Message-passing libraries such as MPI provide operations for exchanges between processes and collective operations across groups. Remote-memory-access facilities offer another communication style, but still have defined access and synchronization rules. They do not make all remote memory behave like unrestricted local variables.
A good partition reduces communication while balancing computation and memory use. Some algorithms exchange only boundary values; others frequently combine information from every participant. Correctness depends on exchanging the right version of data at the right stage. Performance depends on message latency, transfer volume, topology and how much communication can overlap useful work.
Three practical examples
- A simulation divides a spatial grid among nodes and exchanges boundary values before calculating the next step.
- A large analysis distributes rows of a dataset, computes local summaries and combines them without gathering every raw row on one machine.
- An AI training workload places different model components or data batches on separate devices, using communication operations to exchange the information required by its training scheme.
Think of it this way
Think of several analysts, each with a private notebook. An analyst can work quickly with their own notes, but another analyst's updated result must be communicated before it can be used. The same page number in two notebooks need not refer to the same information.
The analogy stops short of describing computer addresses or transport protocols. It highlights data ownership and explicit exchange, not an assumption that communication must always be manual or slow.
Worked example
Consider a fictional grid simulation with 1,000,000 values, each occupying 8 bytes. The main array requires 8,000,000 bytes. Split equally among four processes, each owns 250,000 values, or 2,000,000 bytes, before overhead.
Suppose each process also keeps 1,000 neighboring boundary values received from other processes. That adds 8,000 bytes per process. Its working allocation becomes at least 2,008,000 bytes, excluding output arrays, communication buffers and other state.
The total array fits more easily across the processes, but ownership does not eliminate dependencies. Before a new simulation step uses a neighbor's boundary, it must obtain the required step's values. Using yesterday's boundary with today's interior values can produce a different computation. The numerical sizes illustrate storage accounting, not a particular application's validated memory budget.
Illustrative case study
Fictional case: an environmental modeling team runs a program on several nodes, each with its own local memory. The first version divides grid cells equally, but one region requires more computation per cell, making the other nodes wait at synchronization points.
The team measures work per region and communication volume before changing the partition. It also discovers that a global array is unnecessarily copied in full to every process, limiting the memory benefit. The revised design distributes that array and keeps only the locally required pieces and boundary data.
Correctness checks compare a small distributed run with an established reference calculation. The scenario illustrates data placement, load balance and validation; it does not claim that equal-sized partitions always produce equal work or that the revised program achieves ideal speedup.
Common misconceptions and mistakes
Common mistakes include adding node memory figures and assuming one process can allocate the entire total, confusing a pointer value with a globally valid address, and assuming that identical variable names identify shared storage.
Another mistake is distributing computation while replicating all large data structures on every process. Memory requirements may then remain unchanged per node. Conversely, reducing replication too aggressively can increase communication. The right balance depends on access patterns rather than a universal rule.
Business use
For a business using high-performance or AI computing, the model helps explain why a job may fail for memory reasons despite ample aggregate cluster capacity. Ask about per-process and per-device allocations, temporary buffers and duplicated state.
Performance evaluation should include communication time and imbalance, not only processor utilization. A cluster purchase will not fix an algorithm that repeatedly transfers large amounts of data unnecessarily. Better data placement or a different decomposition can matter as much as additional hardware.
People also ask
Does distributed memory mean data is stored on remote disks?
No. The term concerns memory organization and access. Distributed storage is related but separate.
Can a distributed-memory program run on one machine?
Yes. Multiple processes can communicate through a message-passing interface even when the underlying implementation uses shared physical hardware.
Does changing one process's variable change the others' copies?
Not in the ordinary separate-memory model. Updates become available elsewhere through the program's communication and synchronization mechanisms.
Check your understanding
Four nodes each have 64 gigabytes of usable memory. Can an unchanged single process that allocates a 200-gigabyte array automatically use the combined 256 gigabytes?
Answer: No. Ordinary distributed memory is not one automatically pooled address space. The program needs an appropriate decomposition or a supported abstraction that handles remote data, with its associated overhead.
Related terms
- Shared memory
- Message passing
- MPI
- data decomposition
- halo exchange
- data locality
- remote memory access
- load balancing
- hybrid parallelism
Learn next
study data decomposition and halo exchange using a small grid. Then compare point-to-point communication with collective operations, and measure how local memory requirements and communication change as the number of processes increases.
More in Data engineering and architecture
- Distributed database - A distributed database is a database whose data and database operations are managed across multiple networked nodes.
- Distributed file system for cloud - A distributed file system for cloud is a file-storage system that uses multiple networked machines to provide file access for cloud or cloud-scale workloads.
- Distributed ledger - A distributed ledger is a shared record maintained across multiple networked participants or nodes, using agreed rules to validate and incorporate changes.
- Distributed transaction - A distributed transaction is a transaction whose work involves more than one networked resource or database participant.
- DMAIC - DMAIC stands for Define, Measure, Analyze, Improve and Control.
- Document-oriented database - A document-oriented database stores and queries records as structured documents, commonly containing named fields, nested objects and arrays.
Sources
Lawrence Livermore National Laboratory, Introduction to Parallel Computing Tutorial: https://hpc.llnl.gov/documentation/tutorials/introduction-parallel-computing-tutorial . Primary laboratory guidance on memory architectures, programming models and data ownership. MPI Forum, Processes: https://www.mpi-forum.org/docs/mpi-2.0/mpi-20-html/node22.htm . Standard text on process address spaces. MPI Forum, Remote Memory Access introduction: https://www.mpi-forum.org/docs/mpi-2.1/mpi21-report-bw/node224.htm . Historical standard text illustrating another communication mechanism; relevant indexed passages reviewed.
Previous: Distributed ledger Next: Distributed representation