Skip to content

Commit

Permalink
try to fix mpich compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
CaRoLZhangxy committed Apr 19, 2024
1 parent 60605a9 commit 048c2af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/op/pt/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,13 @@ class Border : public torch::autograd::Function<Border> {
#ifdef USE_MPI
static void unpack_communicator(const torch::Tensor& communicator_tensor,
MPI_Comm& mpi_comm) {
long int* communicator = communicator_tensor.data_ptr<long int>();

#ifdef OMPI_MPI_H
long int* communicator = communicator_tensor.data_ptr<long int>();
#else
long int* ptr = communicator_tensor.data_ptr<long int>();
int* communicator = reinterpret_cast<int*> (ptr);
#endif
mpi_comm = reinterpret_cast<MPI_Comm>(*communicator);
}
#endif
Expand Down

0 comments on commit 048c2af

Please sign in to comment.