Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intermediate integer overflow when writing large files #223

Open
TRPrasanna opened this issue Apr 30, 2024 · 1 comment
Open

intermediate integer overflow when writing large files #223

TRPrasanna opened this issue Apr 30, 2024 · 1 comment

Comments

@TRPrasanna
Copy link
Contributor

TRPrasanna commented Apr 30, 2024

#19 There seems to be still one bug remaining from aforementioned issue that was solved earlier. This appears when writing large files exceeding around 2 GB. For instance, when running the Taylor-Green vortex test case with polynomial order of 11 or more, horses3d will fail to write the initial solution and crash. The bug is in line 2981 of /Solver/src/libs/mesh/HexMesh.f90:

pos = POS_INIT_DATA + (e % globID-1)*5_AddrInt*SIZEOF_INT + padding*e % offsetIO * SIZEOF_RP

What happens is that at some point, the value of

padding*e % offsetIO * SIZEOF_RP

exceeds the value for a 32-bit integer and overflows because it has not been promoted to integer of type AddrInt yet. The solution seems simple, for instance, changing this line to

pos = POS_INIT_DATA + (e % globID-1)*5_AddrInt*SIZEOF_INT + 1_AddrInt* padding*e % offsetIO * SIZEOF_RP

I have suggested the same in my pull request #224

@loganoz
Copy link
Owner

loganoz commented May 3, 2024

Thank you. I approved the pull request to run the test cases in CI and assign the review to one of my collaborators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants