The development of automatic techniques to port a substantial portion of FEFLO, a general-purpose legacy CFD code operating on unstructured grids, to run on GPUs is described. FEFLO is a typical adaptive, edge-based finite element code for the solution of compressible and incompressible flows, which is primarily written in Fortran 77 and has previously been ported to vector, shared memory parallel and distributed memory parallel machines. Owing to the large size of FEFLO and the likelihood of human error in porting, as well as the desire for continued development within a single codebase, a specialized Python script, based on FParser (Int. J. Comput. Sci. Eng. 2009; 4:296–305), was written to perform automated translation from the OpenMP-parallelized edge and point loops to GPU kernels implemented in CUDA, along with GPU memory management. The results of verification benchmarks and performance indicate that performances achieved by such a translator can rival those of codes rewritten by specialists. The approach should be of general interest, as how best to run on GPUs is being presently considered for many so-called legacy codes. Copyright © 2011 John Wiley & Sons, Ltd.
Andrew Corrigan, Fernando Camelli, Rainald Löhner and Fernando Mut. Semi-automatic porting of a large-scale Fortran CFD code to GPUs. International Journal for Numerical Methods in Fluids. Volume 69, Issue 2, pages 314–331, 2012. [doi: 10.1002/fld.2560]