MPI shared memory socket scope#1072
Conversation
|
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.) |
|
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...) |
…nto task/add-mpi3-socket-scope
|
@lc-hubcast approve |
|
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
left a comment
There was a problem hiding this comment.
@lc-hubcast approve
| * | ||
| * \return true when the affinity mask is non-empty and maps to a single socket. | ||
| */ | ||
| bool affinity_maps_to_single_socket(std::string& reason); |
There was a problem hiding this comment.
Is there a better place for this method?
There was a problem hiding this comment.
I made some changes for this...
| "shared_scope::socket for MPI3 shared memory requires Linux CPU affinity information"); | ||
| } | ||
|
|
||
| const int color = get_socket_color_from_affinity(); |
There was a problem hiding this comment.
I don't think this will compile on platforms other than linux. Won't the socket scope code require a macro guard (e.g. #if defined(__linux__)) rather than just an if constexpr?
There was a problem hiding this comment.
I made some changes for this...
|
|
||
| } // end anonymous namespace | ||
|
|
||
| bool affinity_maps_to_single_socket(std::string& reason) |
There was a problem hiding this comment.
Isn't this also defined in umpire.hpp and umpire.cpp?
There was a problem hiding this comment.
I made some changes for this...
| #if defined(__linux__) | ||
| namespace { | ||
|
|
||
| bool all_ranks_affinity_maps_to_single_socket(std::string& reason) |
There was a problem hiding this comment.
This function appears to be duplicated a couple of times.
| #include "umpire/strategy/NamedAllocationStrategy.hpp" | ||
| #include "umpire/util/MemoryResourceTraits.hpp" | ||
|
|
||
| bool all_ranks_affinity_maps_to_single_socket(std::string& reason) |
| } | ||
| #endif | ||
|
|
||
| bool affinity_maps_to_single_socket(std::string& reason) |
There was a problem hiding this comment.
Is this wrapper function actually needed?
| #if defined(__linux__) && defined(UMPIRE_ENABLE_MPI3_SHARED_MEMORY) | ||
| namespace { | ||
|
|
||
| bool all_ranks_affinity_maps_to_single_socket(std::string& reason) |
| GTEST_SKIP() << "Socket-scoped MPI3 shared memory requires ranks bound to a single socket (" << e.what() << ")"; | ||
| } | ||
|
|
||
| auto comm = umpire::get_communicator_for_allocator(allocator, MPI_COMM_WORLD); |
There was a problem hiding this comment.
Don't these communicators need to be cleaned up at the end of the test?
There was a problem hiding this comment.
Amazing, thank you for catching that. Yes they do
| ASSERT_EQ(socket_data[0], 42); | ||
| ASSERT_EQ(socket_data[1], nranks); | ||
|
|
||
| allocator.deallocate(socket_data); |
There was a problem hiding this comment.
Clean up cached communicators?
No description provided.