3 x Speed Improvement for Computational Fluid Dynamics Solver
Real-world success stories of NAG HPC Consulting
zCFD by Zenotech is a computational fluid dynamics (CFD) solver for steady-state or time-dependent flow simulation. It is written in Python and C++ and parallelised with OpenMP and MPI.
NAG, acting through our role in the POP project, conducted a Performance Audit to identify potential areas for improvement. This identified that the code was spending a surprisingly large amount of time executing in serial and that one particular OpenMP loop was suffering from load imbalance. The POP team also note that the CPU frequency was being lowered when the code was run on the maximum number of threads (12 for the machine used in the Audit). As a result of the NAG analysis, a number of changes were made to the code which resulted in significant improvements including:
- Code ran 1.65x faster on 12 threads
- A 3x performance improvement over the old code on 12 threads was observed when the modified code was applied to a test case 100x larger
- The average cycle time fell from 3,253ms to 1,185ms, which corresponds to going from 10.4 GFLOPS to 30.6 GFLOPS for a single Broadwell socket
- Load balancing was improved