No history yet

Parallel Paradigms

Shared vs. Distributed Memory

High Performance Computing (HPC) tackles massive computational problems by breaking them into smaller, manageable pieces that can be solved at the same time. This is called parallel processing. The way these pieces are managed and how they communicate depends on the system's memory architecture. The two fundamental models are shared memory and distributed memory.

In a shared memory system, multiple processor cores all have access to a single, common pool of memory. Think of it as a team of engineers working at one large whiteboard. Everyone can see the entire design, read what others have written, and add their own contributions directly. This architecture is common in multi-core CPUs found in everyday desktops and laptops. Communication is fast and implicit because any change made by one core is immediately visible to all others.

Lesson image

However, not all shared memory is created equal. The two main variations are Uniform Memory Access (UMA) and Non-Uniform Memory Access (NUMA).

  • UMA: Every processor can access any part of the memory at the same speed. It's a perfectly organized whiteboard where every spot is equally easy to reach.
  • NUMA: Processors are physically closer to certain banks of memory. Accessing this local memory is faster than accessing memory that is closer to another processor. This is like each engineer having a small notepad at their desk for quick jottings (fast, local access) but still using the main whiteboard for shared information (slower, remote access). Most modern servers use a NUMA architecture to manage the large number of cores.

Building a Supercomputer

When a problem is too big for a single machine, we turn to distributed memory systems. In this model, we connect many individual computers, called nodes, over a network. Each node has its own private processor and memory. They are like separate offices, each with its own whiteboard. If one office needs information from another, they can't just look over; they must explicitly send a message. This is the foundation of most modern supercomputers and .

Lesson image

These nodes are physically organized into racks, which are large cabinets that provide power, cooling, and networking. The performance of the entire cluster hinges on the interconnect—the high-speed network that links all the nodes. It's the nervous system of the supercomputer. Standard Ethernet is too slow for this; HPC systems use specialized technologies like InfiniBand or custom-designed networks to ensure that nodes can communicate with minimal delay, or latency.

Measuring Performance

Adding more processors doesn't always make a program faster. The way performance changes as you add resources is called scalability. There are two primary ways to measure it: strong scaling and weak scaling.

Strong scaling measures how much faster you can solve a fixed-size problem by adding more processors. If you double the number of processors and the runtime is cut in half, you have perfect linear scaling. This is the goal when you have a specific problem and you want the answer as quickly as possible. Eventually, the time spent communicating between processors starts to outweigh the time saved by parallel computation, leading to diminishing returns.

Weak scaling, on the other hand, measures how well your system handles a growing problem. In this case, as you double the number of processors, you also double the total problem size. The goal is to keep the time-to-solution constant. This is important for problems like weather simulations or graphics rendering, where you might want to increase the model's fidelity (a bigger problem) by using a larger computer.

Understanding these architectural paradigms and scaling concepts is the first step in harnessing the power of high performance computing. The choice between a shared or distributed memory approach dictates not only the hardware you use but also the programming strategies you must employ to achieve efficient, scalable results.

Quiz Questions 1/5

What is the core principle that allows High Performance Computing (HPC) to solve massive computational problems efficiently?

Quiz Questions 2/5

Which memory architecture is analogous to a team where each engineer has a personal notepad for quick tasks but everyone also uses a central whiteboard for shared information?