Computational Physics

(Rick Simeone) #1
16.3 Parallelism 551

Figure 16.5. The Ising model partitioned over the nodes of a two-dimensional
torus. The nodes are indicated as the heavy squares and on each node part of the
lattice is shown. The dashed lines represent the couplings between spins residing
on neighbouring nodes.

orfarmer–workermodel. In this model, one processor is the farmer (master) who
tells the workers (slaves) to do a particular job. The jobs are carried out by the work-
ers independently, and they report the results to the farmer, not to each other. An
example is the solution of the Schrödinger equation for a periodic solid. As we have
seen inChapter 6, Bloch’s theorem can be used, which tells us that the Schrödinger
equation for each particular Bloch vectorkin the Brillouin zone can be carried
out independently. So, if the effective one-electron potential is known, the farmer
will tell the workers to diagonalise the Hamiltonian for a set ofk-vectors allocated
previously to the worker nodes. If the workers have finished the diagonalisation,
they send the result back to the farmer who will calculate the charge density for
example. Parts of the latter calculation could also be distributed over the workers.
Another model is the peer-to-peer model, in which the nodes are equivalent; they
exchange data without one processor telling the others what to do. An example is
an MC program for the Ising lattice which is partitioned over a two-dimensional
torus. Each node performs the Metropolis or heat-bath algorithm for the part of the
lattice which has been allocated to it, but it needs the neighbouring spins residing
on other nodes. The idea is represented inFigure 16.5.
Finally, in the macro-pipelining model, each node performs a subtask of a large
job. It yields processed data which are then fed into the next node for further
processing. The nodes thus act in a pipelined mode, hence the name macro-
pipelining, as opposed to micro-pipelining which takes place within a (pipeline-)
processor. An example is the processing of a huge amount of time-series consisting

Free download pdf