Skip to content

MPI shared memory socket scope - #1072

Open
kab163 wants to merge 27 commits into
developfrom
task/add-mpi3-socket-scope
Open

MPI shared memory socket scope#1072
kab163 wants to merge 27 commits into
developfrom
task/add-mpi3-socket-scope

Conversation

@kab163

@kab163 kab163 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@kab163
kab163 marked this pull request as ready for review May 11, 2026 22:55
@kab163
kab163 requested a review from davidbeckingsale May 12, 2026 17:36
@kab163
kab163 requested review from adayton1 and rhornung67 June 1, 2026 21:33
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
adayton1
adayton1 previously approved these changes Jun 3, 2026
@adayton1

adayton1 commented Jun 3, 2026

Copy link
Copy Markdown
Member

Would it be worth considering adding hwloc as a dependency to get the socket info?

@kab163

kab163 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

Would it be worth considering adding hwloc as a dependency to get the socket info?

I think it would be worth considering... I think for now we should merge this and see how people like it. If there's a need/desire to add hwloc later, we can. (Maybe as an optional dependency - like use hwloc if detected, otherwise use the linux system calls/numa like the branch does now.)

Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
@kab163

kab163 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

Update: Hubcast doesn't understand jobs that are allowed to fail. We can either fix the job failure or try to fix within Hubcast somehow.. stay tuned

@adayton1

adayton1 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Update: Hubcast doesn't understand jobs that are allowed to fail. We can either fix the job failure or try to fix within Hubcast somehow.. stay tuned

You'll need to update branch protections under settings -> branches -> develop and list the CI jobs that are required to pass (instead of ci/gitlab.lc.llnl.gov).

@kab163

kab163 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Update: Hubcast doesn't understand jobs that are allowed to fail. We can either fix the job failure or try to fix within Hubcast somehow.. stay tuned

You'll need to update branch protections under settings -> branches -> develop and list the CI jobs that are required to pass (instead of ci/gitlab.lc.llnl.gov).

I don't see where I'd be able to do this in the develop branch's settings... (I'm getting copilot to help me...)

@kab163

kab163 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@lc-hubcast approve

@lc-hubcast

lc-hubcast Bot commented Jul 9, 2026

Copy link
Copy Markdown

To approve syncing this PR, please use the GitHub review comment feature to submit an approval. This ensures approval is tied to a specific commit to avoid the sync of malicious data.

@kab163 kab163 left a comment

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.

@lc-hubcast approve

Comment thread src/umpire/Umpire.hpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp Outdated
Comment thread src/umpire/resource/HostMpi3SharedMemoryResource.cpp
@kab163
kab163 requested a review from MrBurmark July 13, 2026 22:43
#if defined(__linux__)
namespace {

bool all_ranks_affinity_maps_to_single_socket(std::string& reason)

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.

This function appears to be duplicated a couple of times.

@adayton1 adayton1 Jul 28, 2026

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.

This still looks duplicated at least twice (once in each test file).

Comment thread examples/mpi3_shared_memory.cpp Outdated
Comment thread src/umpire/Umpire.cpp Outdated
}
#endif

bool affinity_maps_to_single_socket(std::string& reason)

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.

Is this wrapper function actually needed?

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.

Ah, no this can be reworked. I think codex took me a bit too literally 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.

Without the wrapper, we would call "umpire::resource::affinity_maps_to_single_socket" and with it we call "umpire::affinity_maps_to_single_socket". The point of that wrapper is to make it somewhat easier to call (would be called in the example or test files). But I guess we could also do something else - is there a better way to do this?

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.

It could also potentially have a shorter name in the wrapper version to make it easier to remember...

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.

I don't think it really matters all that much. If this is something used directly by clients, then it's probably OK to keep the wrapper. I'm assuming you aren't defining it at the top level because that would introduce circular dependencies?

Comment thread tests/integration/get_communicator_tests.cpp Outdated
Comment thread tests/integration/get_communicator_tests.cpp
Comment thread tests/unit/resource/mpi3_shared_memory_resource_tests.cpp
adayton1
adayton1 previously approved these changes Jul 28, 2026

@davidbeckingsale davidbeckingsale 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.

Looks good. See comments. Should the affinity related code be moved to a utility file (e.g. like we have a numa file with utility functions)

return std::string{buffer, static_cast<std::size_t>(length)};
}

void check_mpi_call(int error_code, const char* call_name)

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.

this could be moved to the umpire MPI header and applied to all MPI calls elsewhere.


constexpr int IGNORE_KEY{0};

std::string get_mpi3_resource_error_message(int error_code)

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.

Same comment as below.

@adayton1

Copy link
Copy Markdown
Member

The organization looks a lot better now!

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