Bringing to BEAR – Creating a Challenge for the BEAR Challenge

Published: Posted on

This year June came around again and it’s BEAR Challenge time! This is an event we hold every year to try and introduce University of Birmingham undergraduates and masters’ students to the world of High-Performance Computing (HPC). This year we attracted ten groups of students from across the university from computer science, physics, maths, and biology, starting on the 19th of June.

My challenge started quite a bit earlier when I was asked to devise one of the five challenges that would run over three days. When we started thinking about BEAR Challenge, we wanted to make it clear that HPC, especially for a GPU-based system like Baskerville, wasn’t all about machine learning and started to look at other possibilities.  

I’d met Paul Richmond a couple of years before and remembered that one of his principal projects was FlameGPU (https://flamegpu.com/), an Agent-based modelling system designed to use GPUs to boost its performance. An idea began to form…   

Agent-based models attempt to show the emergent properties of a system by applying rules to its simplest constituents and governing their evolution with time according to simple rules. For instance, in a flock of birds (each bird being an agent), how this will look in the next time step is determined by 

  1. A bird’s current velocity 
  1. Trying to stay grouped with other members 
  1. Avoiding collisions 
  1. Aligning direction of travel 

So if you randomly generate a flock of birds with a position and velocity, and then keep applying these rules to them, you start to see the same flocking behaviour we see in the natural world. 

Although conventional mathematical techniques can handle simple situations, eventually the equations can become too difficult to solve. An example of this is where there can be many different types of agents, and even for one agent, the rules might change over time. An example of this is when looking at people for five days they might get up and go to work, and then on the weekend they don’t.  

During the Covid pandemic, Imperial College’s COVID-19 Agent-Based Model (ABM) was used extensively to estimate the effect that different strategies might have on the spread of the disease. In an evolving situation, being able to change the rules governing the system to quickly test a new hypothesis, without worrying about how to solve the equations, makes ABM invaluable. 

Flexibility isn’t obtained for free, and ABMs require considerably more computation than other techniques, so using GPUs on a HPC system such as Baskerville is helpful to offset this. 

For the challenge we set up, we had two types of agents, prey and predators, and we wanted to see how each of their populations would change in response to each other. Each could reproduce, and initially, predators had to eat prey within a certain number of time steps or they would run out of energy and perish. Standard rules were used to govern prey wanting to stick together, and predators not getting too close to one another.  

In the Challenge, students were walked through how to add an additional agent, grass, to the simulation, which prey could eat and which would eventually grow back after a number of cycles. 

The complex way in which the populations of all three agents changed with time is shown below, 

Behind the scenes, an ABM uses a lot of message passing to pass information between the various agents with messages like “You’ve been eaten, munch!” and “Grass now available to eat”. The problem is that this message passing increases dramatically with an increase in agents. This can be simplified if you try to group agents spatially, so only agents near to other agents receive or have to react to messages, and students were asked to investigate this. 

By the end of the session, the participants had worked through nearly all the material and began to have a solid grasp of the concepts behind Agent-Based Modelling so I think all of us ended up getting a good mark.