This is where you get into the nitty-gritty (and stupidly difficult) type of parallel algorithms. When you have e.g. cells that are dependent on their neighbors you can no longer use the trivial divide-and-conquer strategy.<p>Usually the strategy is to break the domain into chunks, with each chunk being multiple cells. Inside the chunk, the processor already has the data for adjacent cells so it can just read it. On the boundaries where some of the adjacent cells are in another chunk and on a different processor, it has to ask for the data... the vast majority of scientific codes here use OpenMP (not so bad, shared memory) or MPI (absolutely miserable to use IMO, but powerful distributed memory) to communicate. There&#x27;s other tools for the job that are nicer than MPI, but they don&#x27;t get much attention from HPC people (who tend to be <i>very</i> conservative with new technology, especially &quot;high-level&quot; abstractions).<p>Inter-processor communication is orders of magnitude slower than querying local memory (especially if that processor is say on another machine), so on top of that there&#x27;s lots of clever methods of what is essentially figuring out how to slice up the problem domain; examples include Red-Black schemes, domain decomposition and Wavefront propagation.<p>To answer your question specifically on boundary conditions (and here I&#x27;m talking about the edges of the whole image where there&#x27;s literally nothing in some cells nearby, not boundaries between partitioned regions like I was above)... you just have to choose something. There are three common approaches, which I&#x27;ll illustrate by imagining you&#x27;re doing a blur that decides how to blur a pixel by looking at the 8 pixels that surround it and that you&#x27;re on the far <i>right</i> edge of the image (so the right three neighboring pixels would lie outside the image):<p>1. Zero - treat the three pixels as black&#x2F;zero when calculating. Equivalently, treat them as whatever arbitrary value you find works best (e.g. white&#x2F;1).<p>2. Reflective - treat the three pixels as whatever value the pixels on the left side at the appropriate positions would be. That is to say, wrap around to the other side.<p>3. Symmetric - treat the right three pixels as if they were the same as the left three (or the center three if you like).<p>This is a common problem also when solving something like a differential equation on a discretized spatial grid. In this case, the edge values are determined based on your boundary conditions- method 1 corresponds to vacuum boundaries, 2. corresponds to periodic boundaries and 3. is a specific type of extrapolated boundary.