Skip to content

I/O and memory diagnostic improvements in DistributedClosestPoint driver - #1952

Draft
kennyweiss wants to merge 16 commits into
developfrom
feature/kweiss/improve-dcp-example-input
Draft

I/O and memory diagnostic improvements in DistributedClosestPoint driver#1952
kennyweiss wants to merge 16 commits into
developfrom
feature/kweiss/improve-dcp-example-input

Conversation

@kennyweiss

@kennyweiss kennyweiss commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

  • This PR improves the I/O capabilities for our DistributedClosestPoint (DCP) driver example
  • The driver now takes a distributed blueprint mesh for the object mesh and for the query mesh
    • It previously used an internally generated mesh of a circle in 2D and a sphere in 3D
    • Re retained the ability to analytically verify the results for input data with the appropriate verification tag
    • The two inputs can be multi-domain or single domain
    • We added test meshes to the axom_data repo, and updated the unit tests to use these
  • Also adds some memory diagnostics to the DCP driver to see how much memory is being used and the extent to which malloc_trim helps clear memory
    • This led to a fix to the underlying DCP implementation to release memory after copying to MPI buffers
    • This bugfix might resolve some user-reported memory issues w/ the DCP algorithm.
  • This PR also improves the convert_sidre_protocol.py script to convert from conduit blueprint formats, instead of just sidre formats
  • It also adds a new python script to generate distributed blueprint point meshes w/ following several point distributions (circle/sphere, annulus/torus, Gaussian, uniform)

Misc:

  • I updated our build skill to be able to build/test w/ MPI on an allocated node, and to work around issues with shroud and symlinks in sandboxed environments

@kennyweiss kennyweiss added bug Something isn't working enhancement New feature or request Quest Issues related to Axom's 'quest' component User Request Issues related to user requests mpi Related to MPI communication Python labels Aug 17, 2026
auto& req = isendRequests.back();
relay::mpi::isend_using_schema(*xferNodes[m_rank], firstRecipForMyQuery, tag, m_mpiComm, &req);
// isend_using_schema() deep-copies into the request buffer.
xferNodes.erase(m_rank);

@kennyweiss kennyweiss Aug 17, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These three xferNodes.erase() seem to save a lot of memory during computeClosestPoint in hip runs

input branch query time RSS peak RSS post-query RSS after trim
100k develop 2.16 s 3.76 GiB 3.76 GiB 3.57 GiB
100k branch 2.14 s 3.64 GiB 3.64 GiB 3.55 GiB
1M develop 22.91 s 5.97 GiB 5.38 GiB 4.33 GiB
1M branch 23.23 s 4.77 GiB 4.27 GiB 4.13 GiB
10M develop 286.76 s 27.81 GiB 9.04 GiB 9.00 GiB
10M branch 285.99 s 15.89 GiB 9.04 GiB 9.00 GiB

Notes:

  • In the 10M case, the peak memory went down from ~28 GB to ~16GB with this change.
  • malloc_trim only helped marginally in develop and even less after the changes in this file
  • This was in a Debug config, so don't read too much into the query times.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice memory reduction for larger problem sizes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks. I think it might essentially be the same fix as #1889, which hasn't merged yet.

Tag: @MrBurmark

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indeed reducing the lifespan of the transfer nodes is the essence of #1889.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@kennyweiss are you planning to collect data on the post #1948 develop?

@kennyweiss kennyweiss Aug 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@MrBurmark -- I rebased my branch on axom@develop after merging both of your PRs and removed my node.erase calls.

I reran the tests w/ and w/o dynamic filtering to confirm that your changes captured the memory improvements (w/ amdclang++ / rocm@7.2.1):

input dynamic filtering query time RSS peak RSS post-query RSS after trim
1M enabled 2.318 s 4.67 GiB 4.16 GiB 4.03 GiB
1M disabled 2.300 s 4.66 GiB 4.16 GiB 4.00 GiB
10M enabled 25.588 s 15.78 GiB 8.93 GiB 8.89 GiB
10M disabled 27.196 s 15.78 GiB 8.93 GiB 8.89 GiB

Note: the previous timings were in a Debug (-O0) config and these are in a DebWithRelInfo (-O2), so don't read too much into the timings changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, thanks @kennyweiss.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for rerunning. AFAIK, codes don't put debug builds out for users 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(I used a Debug config for the initial run since I was focusing on the memory rather than the timings.)

@kennyweiss kennyweiss changed the title Feature/kweiss/improve dcp example input I/O and memory diagnostic improvements in DistributedClosestPoint driver Aug 17, 2026
@kennyweiss

Copy link
Copy Markdown
Member Author

Note: The failing github actions CI job (gcc@13.3.1, shared, 32 bit) is related using a 64-bit type in a 32-bit build. Should be easy to fix.

@rhornung67 rhornung67 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@kennyweiss thank you for this.

@kennyweiss
kennyweiss force-pushed the feature/kweiss/improve-dcp-example-input branch 2 times, most recently from 964752c to 7404b58 Compare August 19, 2026 04:07
When provided, we use that instead of an analytically generated mesh.
Allow for topologies other than "mesh" and for unstructured topologies.
And for input meshes without a "fields" group.
... and remove analytical generation from DCP example.
Also adds troubleshooting sections about shroud and about symlinked paths.
The test meshes match the previous analytically generated circle/sphere and are validated.
* In convert_sidre_protocol, run w/ correct protocol
* In new point mesh generator script, ensure MPI/conduit are available when we expect them
* Fix check for multi-domain runs
@kennyweiss
kennyweiss force-pushed the feature/kweiss/improve-dcp-example-input branch from 14519a2 to f97c476 Compare August 25, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request mpi Related to MPI communication Python Quest Issues related to Axom's 'quest' component User Request Issues related to user requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants