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

Diagnose gatherv overflow #113

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

mpotse
Copy link
Contributor

@mpotse mpotse commented May 18, 2024

The displacements argument to MPI_Gatherv() in PMMG_gather_parmesh() overflows when the combined packed mesh size exceeds 2^31. This commit does not solve the problem but it produces the right error message and an MPI_Abort() before an allocation error would occur. It also changes MEM_CHK_AVAIL to show the allocation size when an allocation fails, to make this kind of situation easier to diagnose.

Btw it looks like the size limit of ParMmg is actually smaller than that of mmg3d compiled with 32-bit indices; I encountered this problem with an input that takes 1.6GB storage while with mmg3d I have successfully treated a mesh that took 6.3GB storage. Also in terms of vertices and tetrahedra that mesh was much larger.

Of all possible solutions for this problem, I think the best would be to replace the gather operation by send/receive pairs. This would avoid the allocation of a buffer for the whole (packed) mesh.

mpotse added 3 commits May 8, 2024 17:16
…in PMMG_gather_parmesh exceeds INT_MAX

  This problem occurs when the size of the first np-1 of the compressed mesh parts exceeds INT_MAX.
  This commit introduces an error message for this circumstance, which replaces an error on a negative allocation size.
  It also shows the allocation size in the error message for allocation failur so that this kind of problem is easier to diagnose.
Copy link

codecov bot commented May 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (develop@eaebcbe). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #113   +/-   ##
==========================================
  Coverage           ?   63.05%           
==========================================
  Files              ?       46           
  Lines              ?    18924           
  Branches           ?     3533           
==========================================
  Hits               ?    11933           
  Misses             ?     6068           
  Partials           ?      923           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Algiane Algiane self-requested a review August 1, 2024 15:04
@Algiane Algiane added kind: bug Something isn't working kind: enhancement enhancement to an existing feature part: parmmg specific to parmmg code part part: MPI / HPC MPI or HPC related labels Aug 1, 2024
@Algiane Algiane merged commit babaf07 into MmgTools:develop Aug 1, 2024
22 checks passed
@Algiane
Copy link
Member

Algiane commented Aug 1, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working kind: enhancement enhancement to an existing feature part: MPI / HPC MPI or HPC related part: parmmg specific to parmmg code part
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants