Pandora is an agent-based modeling framework designed for the Humanities and Social Sciences. Simulation is gaining ground in these fields, as such models naturally capture how knowledge is acquired and accumulated in human societies, and they provide a more natural fit than abstract mathematical models. Real-world terrain, climate data, precipitation, and many other parameters can be included. Emergent behavior can typically observed only in large-scale simulations, and hence Pandora uses MPI and OpenMP to run simulations on a high-performance cluster. This poster is a case study in which we accelerated the critical computational loop of a simulation scenario by up to 7x using Thrust and a Tesla GPU. The acceleration is crucial to verify a larger number of alternative simulation scenarios, as an extensive range of parameter combinations are valid and may lead to fundamentally different conclusions. To achieve the speedup, we had to completely redesign the data access pattern, which was originally optimized for latency-oriented CPUs with sizable cache memory and a cache coherence protocol. The "horizon" of an individual agent causes the majority of irregular memory accesses. Moreover, there are thousands of agents in a simulation, each with its own horizon. We introduced a stencil to arrive at a rectangular memory region, and we perform a 2D stencil-based reduction to update an agents knowledge. While the acceleration naturally maps to a GPU cluster, further work is necessary to achieve a consistent speedup outside the critical region. Currently only the computationally most demanding region, the update of an agent's knowledge is accelerated, leading to a very low, 4-6 % utilization of the GPU. By performing all actions of an agent on the GPU, multiple agents could be executed simultaneously, leading to a much higher utilization.
Sponsorship:
The second author is supported by the SimulPast Project (CSD2010-00034), funded by the CONSOLIDER-INGENIO2010 program of the Ministry of Science and Innovation -- Spain. This work is also supported by AWS in Education Machine Learning Grant award.