Evaluating the Performance Impact of Floating-Point Type Demotion in a Multiphase Flow Simulator
Resumo
This paper evaluates precision demotion in Marlim3, an open-source 1D multiphase flow simulator developed by Petrobras. We replace long double declarations, extended-precision literals, and long-double libm calls with double-precision equivalents. The original and modified versions are compared using nine simulation cases on x86-64 and ARM platforms, considering runtime and numerical differences in the outputs. On x86-64, the modified version improved all workloads, reaching up to 11.69× speedup. On Apple M4, most workloads remained close to the baseline. Numerical validation reused the baseline workflow: steady-state network outputs match the extended-precision reference within engineering tolerance, while transient cases show only the expected accumulation of round-off, with all monitored quantities physically plausible. These results show that precision demotion can improve Marlim3 performance, but its impact is strongly architecture-dependent.
Referências
Goldberg, D. (1991). What every computer scientist should know about floating-point arithmetic. ACM Computing Surveys, 23(1):5–48.
Higham, N. J. and Mary, T. (2022). Mixed precision algorithms in numerical linear algebra. Acta Numerica, 31:347–414.
Monniaux, D. (2008). The pitfalls of verifying floating-point computations. ACM Transactions on Programming Languages and Systems, 30(3).
Petrobras (2026). Marlim3: Petrobras Multiphase Flow Simulator. [link]. Accessed: 2026-04-29.
Rubio-González, C., Nguyen, C., Nguyen, H. D., Demmel, J., Kahan, W., Sen, K., Bailey, D. H., Iancu, C., and Hough, D. (2013). Precimonious: Tuning assistant for floating-point precision. In Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis, SC ’13. ACM.