Skip to content

Commit

Permalink
type to fix mpich
Browse files Browse the repository at this point in the history
  • Loading branch information
CaRoLZhangxy committed Apr 17, 2024
1 parent 3d0f14d commit 14a5fed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/op/pt/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ class Border : public torch::autograd::Function<Border> {
static void unpack_communicator(const torch::Tensor& communicator_tensor,
MPI_Comm& mpi_comm) {
long int* communicator = communicator_tensor.data_ptr<long int>();
mpi_comm = reinterpret_cast<MPI_Comm>(*communicator);
int* int_ptr = reinterpret_cast<int*>(communicator);//in order to solve mpich type, may cause error
mpi_comm = reinterpret_cast<MPI_Comm>(*int_ptr);
}
#endif
};
Expand Down

0 comments on commit 14a5fed

Please sign in to comment.