Evaluating the Performance Impact of Floating-Point Type Demotion in a Multiphase Flow Simulator

  • Vitor Barros Aquino Cesar School
  • Pedro Henrique Casarotto Rigon CESAR
  • Gabriel Freytag CESAR
  • Afranio Jose de Melo Junior Petróleo Brasileiro S.A.
  • Eduardo Ferreira Gaspari Petróleo Brasileiro S.A.
  • Evaldo Costa Cesar School

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

Chiang, W.-F., Baranowski, M., Briggs, I., Solovyev, A., Gopalakrishnan, G., and Rakamaric, Z. (2017). Rigorous floating-point mixed-precision tuning. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL ’17, pages 300–315. ACM.

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.
Publicado
08/07/2026
AQUINO, Vitor Barros; RIGON, Pedro Henrique Casarotto; FREYTAG, Gabriel; MELO JUNIOR, Afranio Jose de; GASPARI, Eduardo Ferreira; COSTA, Evaldo. Evaluating the Performance Impact of Floating-Point Type Demotion in a Multiphase Flow Simulator. In: ESCOLA REGIONAL DE ALTO DESEMPENHO DA REGIÃO NORDESTE (ERAD-NE), 7. , 2026, Recife/PE. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2026 . p. 78-82. DOI: https://doi.org/10.5753/erad-ne.2026.26646.