-
Josh Borrow authoredJosh Borrow authored
Public Information
What is SWIFT?
SWIFT is a hydrodynamics and gravity code for astrophysics and cosmology. What does that even mean? It is a computer program designed for running on supercomputers that simulates forces upon matter due to two main things: gravity and hydrodynamics (forces that arise from fluids such as viscosity). The creation and evolution of stars and black holes is also modelled together with the effects they have on their surroundings. This turns out to be quite a complicated problem as we can't build computers large enough to simulate everything down to the level of individual atoms. This implies that we need to re-think the equations that describe the matter components and how they interact with each-others. In practice, we must solve the equations that describe these problems numerically, which requires a lot of computing power and fast computer code.
We use SWIFT to run simulations of Astrophysical objects, such as galaxies or even the whole Universe. We do this to test theories about what the Universe is made of and evolved from the Big Bang up to the present day!
Why create SWIFT?
We created SWIFT for a number of reasons. The primary reason beings that we want to be able to simulate a whole Universe! This has been done before successfully (see the EAGLE Project for more details), but this simulation used a software which is not tailored for the newest super-computers and took almost 50 days on a very large computer to complete. SWIFT aims to remedy that by choosing to parallelise the problem in a different way, by using better algorithms and by having a more modular structure than other codes making it easier for users to pick and choose what physical models they want to include in their simulations.
The way that super-computers are built is not by having one huge super-fast 'computer', but rather by having lots of regular computers (only a tiny bit better than what is available at home!) that are connected together by high-speed networks. Therefore the way to speed up your code might not necessarily be to make it 'run faster' on a single machine, but rather enable those machines to talk to each other in a more efficient way. This is how SWIFT is different from other codes that are used in Astrophysics for a similar purpose: the focus is on distributing the work to be done (the equations to be solved) in the best possible way across all the small computers that are part of a super-computer.
Traditionally, you have each 'node' (computer) in the 'cluster' (supercomputer) running the exact same code at the exact same time, and at the end of each bit of the problem they all talk to each other and exchange information. SWIFT does this a little differently, with each node working on different tasks than others as and when those tasks need to be completed. SWIFT also makes the nodes communicate with each others all the time and not only at fixed points, allowing for much more flexibility. This cuts down on the time when a node is sitting and waiting for work, which is just wasted time, electricity and ultimately money!
One other computer technology that occured in the last decade is the appearance of so-called vector-instructions. These allow one given computing core to process not just one number at a time (as in the past) but up to 16 (or even more on some machines!) in parallel. This means that a given compute core can solve the equations for 16 stars (for instance) at a time and not just one. However, exploiting this capability is hard and requires writing very detailed code. That is rarely done in other codes but our extra efforts pay off and SWIFT can solve the same equations as other software in significantly less time!
What is SPH?
Smoothed Particle Hydrodynamics (SPH) is a numerical method for approximating the forces between fluid elements (gas or liquids). Let's say that we want to simulate some water and a wave within it. Even a single liter of water has 100000000000000000000000000 particles in it. To store that much data we would require a computer that as 100 trillion times as much storage space as all of the data on the internet. It's clear that we need a more efficient way of simulating this water if we are to have any hope!
It turns out that we can represent the water by many fewer particles if we can smooth over the gaps between them efficiently. Smoothed Particle Hydrodynamics is the technique that we use to do that.
SPH was originally developped to solve problems in astrophysics but is now a popular tool in industry with applications that affect our everyday life. Turbines are modelled with this technique to understand how to harvest as much energy from the wind. The method is also used to understand how waves and tsunamis affect the shores, allowing scientists to design effective defence for the population.