Select Page

An Ant Farm for the Supercomputer

By Rob Mitchum // May 8, 2014

Ant farms were once one of the most popular toys in the world, with over 20 million sets sold since their invention in the early 1950’s. The appeal of ant farms — or formicariums, to use the technical, non-copyrighted term — was to watch the tiny insects spontaneously construct an elaborate network of tunnels and chambers in the sand. That basic principle of simple behaviors producing complex results also applies to a popular branch of computer modeling now applied to everything from economics to ecology to epidemiology: agent-based modeling.

In agent-based models, computer scientists create a population of “agents” that operate by very simple rules. For example, when an agent comes close to another agent, they may be coded to move away in the opposite direction or transfer a particular status, such as a “disease,” to the second agent. Scale that system up to thousands, millions, or even billions of agents, and scientists can use the model to recreate massive complex systems, such as financial markets, ecosystems, urban transportation, or even terrorist networks.

“Agent-based models are very good at demonstrating emerging properties, population-level effects that are the result of individual rules,” said John T. Murphy, computational postdoctoral fellow with Argonne’s Decisions and Information Science (DIS) Division. “They’re useful where the world is messy and broken up into pieces that are not easily reducible to equations, or where a top-down approach won’t work.”

To help researchers construct their own agent-based models, DIS scientists developed open-source software called Repast, the Recursive Porous Agent Simulation Toolkit. The group first released Repast Simphony, a desktop program for designing and running agent-based models. But as scientists seek larger and larger models to tackle more ambitious research questions, there is a growing need for the construction of agent-based models that can run on supercomputers, including some of the fastest machines in the world housed at Argonne.

So DIS researchers built a new form of Repast, called Repast HPC. The software is similar to Repast Simphony, but optimizes models for the parallel computing architectures used by today’s most powerful supercomputers. Instead of running the entire model sequentially on one processor, Repast HPC can split up the world of the model among the many thousands of processors available on machines such as Mira, for faster performance.

Parallelizing an agent-based model can be quite difficult, Murphy said. Splitting up the model across multiple cores means chopping up either the physical space simulated by the model (such as a city or ecosystem) or the network of agent relationships. Agents that are far away from each other either in space or within a network are very unlikely to interact during a given step of the model. But agents that are close to the boundaries where the model has been split may interact with an agent that is being simulated on another core, so Repast HPC copies any agent in a “buffer zone” around the boundaries.

These copied “non-local” agents can then interact with other agents on that piece of the model, while the original agent stays on its own processor. Between each step, synchronization functions update any changes encountered by the non-local agents back to their original source. The larger the model — and the more processors it is spread out across — the more expensive these synchronization steps can get, Murphy said.

But despite these technical hurdles, agent-based models are increasingly used for simulating a wide variety of topics. Murphy himself uses models built in Repast to study water management in the western United States, while a team of DIS scientists recently collaborated with UChicago Medicine physicians to study how MRSA infections spread through the city. Other uses mentioned in the discussion included studying the macro-scale effects of microeconomics theories, predicting consumer behavior, and simulating predator-prey relationships in the wild. Those are some pretty big ant farms, providing important scientific insights.

You can watch archived video of Murphy’s talk here.