Add OpenMP constructs to two critical loops in the stack:
The nearest neighbor function
The distance matrix computation
These changes were after several iterations of testing different strategies. I ultimately tried to change as little as possible to ensure correctness. The whitespace changes are from the IDE normalizing the padding.
When running, you can control the behavior of the parallelization by setting the OMP_NUM_THREADS environment variable. To run the simulation serially set this variable to 1. By default it will use the number of cores present on the system.
Finally, this is to complement the MPI work done previously. When we're ready to move this onto a supercomputer we can set OMP_NUM_THREADS to the appropriate amount to take advantage of the capabilities of a particular node.
Add OpenMP constructs to two critical loops in the stack:
These changes were after several iterations of testing different strategies. I ultimately tried to change as little as possible to ensure correctness. The whitespace changes are from the IDE normalizing the padding.
When running, you can control the behavior of the parallelization by setting the OMP_NUM_THREADS environment variable. To run the simulation serially set this variable to 1. By default it will use the number of cores present on the system.
Finally, this is to complement the MPI work done previously. When we're ready to move this onto a supercomputer we can set OMP_NUM_THREADS to the appropriate amount to take advantage of the capabilities of a particular node.