Skip to content

Modify the MPIFace process send-recv in HexMesh and MPIFace. Add test case for MLRK#271

Closed
hmarbona wants to merge 16 commits into
loganoz:masterfrom
hmarbona:master
Closed

Modify the MPIFace process send-recv in HexMesh and MPIFace. Add test case for MLRK#271
hmarbona wants to merge 16 commits into
loganoz:masterfrom
hmarbona:master

Conversation

@hmarbona
Copy link
Copy Markdown
Collaborator

This pull request modify the MPI face process to send and recv data of MPIfaces. The modification is to prevent memory leaking and communication mismatch in the solver. Mainly tested for multiphase for long run. A new monitor is added to monitor the total memory (see Cylinder_MLRK test).
A new test case, Cylinder_MLRK is added in the NavierStokes test case to check MLRK time scheme.

Himpu Marbona added 12 commits August 7, 2025 19:40
This commit allow a better MPI partitioning for MLRK explicit time integration for both METIS and SFC method
Destruct BC is moved inside the mesh%destruct
The MPI communication subroutines (MPIFace.f90 and UpdateMPIFaces...) are modified - Checked for memory leak. A new subroutine is added into Utilities.f90 (log_mem) for debug memory leak
New memory monitor is added into residual (optional) and Cylinder_MLRK test case is available in NS
if (allocated(weights)) deallocate(weights)
if (allocated(tpwgt)) deallocate(tpwgt)
if (allocated(vsize)) deallocate(vsize)
if (associated(vwgt)) nullify(vwgt) ! vwgt is a pointer to a target. nullify is enough
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nullify(vwgt) must be placed before deallocate(weights). If not, there might be a memmory leak because the pointer is pointing to a void memmory.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good suggestion. I missed it. Thanks

if (allocated(weights)) deallocate(weights)
if (allocated(tpwgt)) deallocate(tpwgt)
if (allocated(vsize)) deallocate(vsize)
if (associated(vwgt)) nullify(vwgt) ! vwgt is a pointer to a target. nullify is enough
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, nullify(vwgt) before deallocate(weights)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good suggestion. I missed it. Thanks


call convPoints% destruct()

nullify(p, p1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nullify must go before the destruction of the target convPoints.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is okay, but I move it above as requested

@@ -73,6 +74,7 @@ subroutine ConstructZones( faces , zones )
call ConstructBoundaryConditions(no_of_markers, zoneNames)

deallocate (zoneNames)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we want to deallocate? What we are deallocating is zoneNameDictionary % allKeys(). Is it a function that returns an independent array, or is it a reference to something else? If it's an independent array, it should be replaced with an allocatable array if posible. In case it's a reference, maybe we only want to nullify the pointer, not deallocate. It should be checked anyway.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didnt do anything on above code

@@ -113,6 +115,7 @@ subroutine ReassignZones( faces , zones )
call Zone_AssignFaces(faces,zones,no_of_markers,zoneNames)

deallocate (zoneNames)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here didnt do anything

Copy link
Copy Markdown
Collaborator

@Dhueper Dhueper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've included some comments that you should check before merging.

@hmarbona
Copy link
Copy Markdown
Collaborator Author

hmarbona commented Sep 4, 2025

I will wait for edu pull then open new request to make things easier for him

hmarbona and others added 3 commits September 19, 2025 11:29
This commit reduce the work in the MLRK and MU (prolongsolutionintofaces)
@hmarbona hmarbona closed this Sep 19, 2025
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

Successfully merging this pull request may close these issues.

3 participants