Improving earthquake forecasting methods
While our ability to observe and record earthquake activity has advanced significantly in the last decade, some key information remains elusive.
“We can’t really say when the next large earthquake is going to hit and that’s a very challenging question,” says Dr. Ting Wang, a senior lecturer in the Department of Mathematics and Statistics at the University of Otago.
Accurate advance warnings of large earthquakes could potentially mitigate property damage, activate early response efforts, and most importantly, save lives. Supported by NeSI computing resources and technical expertise, Wang is building and testing statistical models that could one day provide better estimation of when a large earthquake could strike.
One of her biggest challenges is that she needs to constantly test her calculations, then adjust or add parameters, and re-test again. Access to NeSI’s Pan supercomputer allows her to run her calculations using multiple scenarios and get results quickly to ensure she’s on the right track.
“With NeSI, each time I can use 1,000 cores and that makes a big difference,” Wang says. “And the consultant team’s help has made everything possible because otherwise we’d have to wait for months to get a set of results, and may then restart the program if we haven’t obtained satisfactory results.”
Wang has enlisted the help of NeSI’s Solutions Team for two projects related to her earthquake research. Her first project, funded by the Earthquake Commission (EQC), aims to develop a statistical model that automatically classifies earthquake activities into distinct phases, such as foreshocks, mainshocks, and aftershocks. Foreshocks are mild tremors that lead up to the major shaking of an earthquake. They can often happen hours, days or even weeks prior to an earthquake. Mainshocks are the largest tremors in the earthquake sequence, and aftershocks are the final sequence, sometimes occurring months later.
To date, Wang has been working with earthquake data sequences from northern California and the Middle America Trench, a 2,750 km long oceanic trench in the Pacific Ocean running from central Mexico to Costa Rica. Known as one of the deepest trenches in the world, many large earthquakes have occurred in the area, and the data from those quakes are available online for researchers anywhere in the world to use and analyse.
With the data in hand, Wang wrote a program for running her computational simulations, but she found it took too long to return the results she needed.
“If we want to solve real world problems, we need sophisticated models to capture what’s happening in the real world, which is not simple,” she says. “We are researchers in different fields but we are not experts in programming. I can make everything work, but if I want something to run fast, it requires some real expertise in programming.”
Otago’s research office referred her to Peter Maxwell, a member of NeSI’s Solutions Team.
“He was super helpful,” Wang says. “He came to see me in my office and explained to me how I could make use of Pan and then he even looked at all my R programs and suggested improvements. Whenever I had a problem I would just email Peter and he would immediately reply and help me with it. I’m very grateful for that.”
He also applied OpenACC, a parallel programming model, to run her Fortran code on Graphics Processing Units (GPUs) to get results in just a few days. Since then, and with the help of another NeSI consultant, Wolfgang Hayek, Wang’s programs have been refined even further.
“[Wolfgang] actually looked through my program line by line - and it’s a really long program - and he made things more efficient,” she says. “I was pleased because after his help, I can now get hundreds of results on CPUs within a few hours. It’s even better than before. I’m testing it extensively and it’s working really well.”
Wang plans to make her code available online eventually, and these latest productivity improvements will make them useful for other researchers as well, both within and beyond her research field. Her models can be applied to anything that occurs randomly or that is triggered by something else. This makes them useful for studying and understanding things like crime rates, forest fires, even infectious diseases.
Wang’s second project, funded through a Marsden Fund Fast-Start Grant, studies earthquake and volcanic eruption data but aims to address a different challenge.
“Most of the time it’s relatively easy to work with homogeneous processes. But complex natural processes vary over time, making the model more complicated as a result,” Wang says.
For example, past records of volcanic eruptions will often have gaps in information scattered throughout. People simply weren’t as diligent about or capable of recording geophysical activity that occurred tens, hundreds, or thousands of years ago. Wang and her PhD student Amina Shahzadi are investigating ways that missing data points can be accounted for and factored into sequence analysis and hazard forecasts.
“Estimating the parameters related to the model becomes a challenge,” says Wang. “That’s why we needed NeSI, because the program for estimating the parameters requires high computing power to run within acceptable time frames.”
They brought in NeSI consultant Alexander Pletzer to help.
“He did a great job,” says Wang. “He explained in detail what changes he made and explained how we could write our program to make it fast from the beginning.”
Wang and Shahzadi are currently working with a larger data set. Using Pletzer’s expertise and programming advice, they were able to run their code on Pan and have results to study in hours instead of days.
Wang has papers in progress for both projects and says she is looking forward to using her improved code and models on new datasets.
“Now that my program is fast, I’m going to look at some NZ sequences,” she says.
Below you’ll find additional, more technical details describing the NeSI Team’s support for this project. If you would like to talk to NeSI’s solutions team about your project, contact email@example.com.
The NeSI Solutions team worked on multiple iterations of Ting Wang’s code, providing technical support such as:
- optimising early versions of the R and Fortran code to achieve faster execution speeds and produce results in a shorter period of time
- improving vectorisation of loops in Fortran, allowing the processors to compute multiple numbers in a single step
- implementing small code improvements and storing results in memory for reuse to avoid costly re-computations of intermediate results
- adding the capability to run the program in parallel on hundreds of GPU cores using the OpenACC programming interface, resulting in a 30-fold speedup
- adding the capability to run the program in parallel on multiple CPU cores using the OpenMP programming interface, taking advantage of the large number of available cores on NeSI’s platforms