12 template <TargetComm Target>
14 if (win_m != MPI_WIN_NULL) {
20 template <TargetComm Target>
21 template <std::contiguous_iterator Iter>
24 "No active target communication window");
31 count_m = std::distance(
first, last);
32 int dispUnit =
sizeof(
typename Iter::value_type);
33 MPI_Aint size = (MPI_Aint)count_m * dispUnit;
34 MPI_Win_create(&(*
first), size, dispUnit, MPI_INFO_NULL, comm, &win_m);
39 template <TargetComm Target>
40 template <std::contiguous_iterator Iter>
48 MPI_Win_create_dynamic(MPI_INFO_NULL, comm, &win_m);
52 count_m = std::distance(
first, last);
53 MPI_Aint size = (MPI_Aint)count_m *
sizeof(
typename Iter::value_type);
54 MPI_Win_attach(win_m, &(*
first), size);
59 template <TargetComm Target>
60 template <std::contiguous_iterator Iter>
66 MPI_Win_detach(win_m, &(*
first));
70 template <TargetComm Target>
73 "No active target communication window");
74 MPI_Win_fence(asrt, win_m);
77 template <TargetComm Target>
78 template <std::contiguous_iterator Iter>
81 MPI_Datatype
datatype = get_mpi_datatype<typename Iter::value_type>(*
first);
82 auto count = std::distance(
first, last);
83 if (count > count_m) {
86 if (request ==
nullptr) {
95 template <TargetComm Target>
98 MPI_Datatype
datatype = get_mpi_datatype<T>(*value);
99 if (request ==
nullptr) {
102 MPI_Rput(value, 1,
datatype, dest, (MPI_Aint)pos, 1,
datatype, win_m, *request);
106 template <TargetComm Target>
107 template <std::contiguous_iterator Iter>
110 MPI_Datatype
datatype = get_mpi_datatype<typename Iter::value_type>(*
first);
111 auto count = std::distance(
first, last);
112 if (count > count_m) {
113 throw IpplException(
"Window::put",
"Count exceeds RMA window size.");
115 if (request ==
nullptr) {
124 template <TargetComm Target>
125 template <
typename T>
127 MPI_Datatype
datatype = get_mpi_datatype<T>(*value);
128 if (request ==
nullptr) {
139 template <TargetComm Target>
142 "No passive target communication window");
143 MPI_Win_flush(rank, win_m);
146 template <TargetComm Target>
149 "No passive target communication window");
150 MPI_Win_flush_all(win_m);
153 template <TargetComm Target>
156 "No passive target communication window");
157 MPI_Win_lock(locktype, rank, asrt, win_m);
160 template <TargetComm Target>
163 "No passive target communication window");
164 MPI_Win_lock_all(asrt, win_m);
167 template <TargetComm Target>
170 "No passive target communication window");
171 MPI_Win_unlock(rank, win_m);
174 template <TargetComm Target>
177 "No passive target communication window");
178 MPI_Win_unlock_all(win_m);
constexpr KOKKOS_INLINE_FUNCTION auto first()
Implementations for FFT constructor/destructor and transforms.
void get(Iter first, Iter last, int source, unsigned int pos, Request *request=nullptr)
bool create(const Communicator &comm, Iter first, Iter last)
bool attach(const Communicator &comm, Iter first, Iter last)
void lock(int locktype, int rank, int asrt=0)
void put(Iter first, Iter last, int dest, unsigned int pos, Request *request=nullptr)