cache node IDs in MPI communicator#223
Merged
wkliao merged 6 commits intoParallel-NetCDF:masterfrom Feb 14, 2026
Merged
Conversation
github copilot code quality
[nitpick] Variable name `dir_name` uses underscore convention while
`path_dup` uses underscore as well, but the naming could be more
consistent with the project's naming conventions. Consider using
consistent naming patterns throughout the file.
In case the same communicator is used to create/open multiple files, we can cache the node IDs of all processes as attributes of the MPI communicator, so they can be reused every time the same communicator is used to create/open a file in the same application run. Using the cached node IDs can avoid repeatedly calling MPI_Get_processor_name(), MPI_Gather(), and MPI_Bcast() to construct the node IDs. Note cb_nodes, the number of I/O aggregators, and rank IDs of I/O aggregators cannot be reused by another file, because cb_nodes is a hint that may be set to a different value each time file is created/opened. Thus cb_nodes and rank IDs of I/O aggregators must be recalculated at each file create/open. Fortunately, Lustre_set_cb_node_list() and GEN_set_cb_node_list() do not make any MPI communication calls. The cost of recalculating cb_nodes and rank IDs is expected to be small.
Node IDs and the number of compute nodes are generated during file creation or opening at the dispatcher.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calculating compute node IDs of MPI processes in a given MPI communicator is
necessary for intra-node aggregation as well as selecting a good value for hint
cb_nodes. Such calculation is done at file create and open time, which requires
MPI communication. Caching the node IDs into the MPI communicator can save
costs when the same communicator is used in successive file create/open calls.