Skip to content

Commit

Permalink
Fix MPI_Group initialization errors (#124824)
Browse files Browse the repository at this point in the history
Fixes MPI_Group initialization errors introduced in #124156, since MPI_Group is not a pointer in some MPI implementations.

Pull Request resolved: #124824
Approved by: https://github.com/ezyang
  • Loading branch information
cyyever authored and pytorchmergebot committed Apr 25, 2024
1 parent 29b22fb commit a8aed4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torch/csrc/distributed/c10d/ProcessGroupMPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ c10::intrusive_ptr<ProcessGroupMPI> ProcessGroupMPI::createProcessGroupMPI(

// If no ranks are specified, assume we're creating the root group
if (!ranks.empty()) {
MPI_Group worldGroup = nullptr;
MPI_Group ranksGroup = nullptr;
MPI_Group worldGroup{};
MPI_Group ranksGroup{};
MPI_CHECK(MPI_Comm_group(MPI_COMM_WORLD, &worldGroup));
MPI_CHECK(
MPI_Group_incl(worldGroup, ranks.size(), ranks.data(), &ranksGroup));
Expand Down

0 comments on commit a8aed4c

Please sign in to comment.