1 #ifndef SEND_RECV_TOROIDAL_HPP
2 #define SEND_RECV_TOROIDAL_HPP
12 struct MPIDataType<double> {
13 static MPI_Datatype value() {
return MPI_DOUBLE; }
18 struct MPIDataType<int> {
19 static MPI_Datatype value() {
return MPI_INT; }
23 void send_to_neighbor_plane(
const MyMPI& mpi,
const T& source_view,
const T& dest_view,
bool send_right){
26 int source_dist = send_right ? -1 : 1;
29 int isendtag = this_rank;
30 int irecvtag = source_rank;
31 MPI_Datatype datatype = MPIDataType<typename T::value_type>::value();
32 MPI_Sendrecv(source_view.data(), source_view.size(), datatype,dest_rank, isendtag,
33 dest_view.data(), dest_view.size(), datatype,source_rank,irecvtag,
38 void send_right(
const MyMPI& mpi,
const T& source_view,
const T& dest_view){
39 send_to_neighbor_plane(mpi, source_view, dest_view,
true);
43 void send_left(
const MyMPI& mpi,
const T& source_view,
const T& dest_view){
44 send_to_neighbor_plane(mpi, source_view, dest_view,
false);
int my_intpl_rank
Definition: my_mpi.hpp:49
KOKKOS_INLINE_FUNCTION unsigned positive_modulo(int value, unsigned m)
Definition: globals.hpp:211
Definition: my_mpi.hpp:19
MPI_Comm intpl_comm
Definition: my_mpi.hpp:48
int n_intpl_ranks
Definition: my_mpi.hpp:50