---
# System prepended metadata

title: Parallelism

---

# Parallelism

Parallelising the code will be fairly trivial. Each walker is updated independently of all others and local energies only need to be combined in a single average when evaluating the variational energy at each set of parameters ($E^{\alpha}_{V}$ for the quantum harmonic oscillator, $E^{c}_{V}$ for $H_{2}^{+}$, $E^{\mathbf{c}}_{V}$ for $H_{2}$). This type of code naturally lends itself to MPI parallelism, with each MPI rank taking responsibility for a subset of the total number of walkers. A gather operation can then be performed at the end of the walker iterations for each parameter in order to average the local energies on MPI rank 0.

In order for each MPI rank to generate unique results, the random number generator on each rank will be given a rank-dependent seed. This will ensure that different ranks will generate unique positions for the walkers.

If performance-intensive loops are identified within the code, OpenMP parallelism may be implemented to enable a hybrid MPI/OpenMP code. This will reduce the gains made by splitting the walkers between MPI ranks, but could provide an overall performance increase if used correctly. Benchmarking will be undertaken across all implemented problems to identify the correct division of processors between MPI and OpenMP parts of the code, if this hybrid approach gets taken.