Loading...
Searching...
No Matches
UPstreamWindow.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26\*---------------------------------------------------------------------------*/
27
28#include "UPstreamWindow.H"
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
34 UPstream::Window(nullptr)
35{}
36
37
38// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
41{
42 return false;
47{}
48
49
51{
52 return 0;
53}
54
55
56// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57
58std::pair<void*,int64_t>
60(
61 std::streamsize num_elements,
62 int disp_unit,
64 const bool shared
65)
68 return {nullptr, 0};
69}
70
71
72std::pair<void*,int64_t>
74(
75 std::streamsize num_elements,
76 int disp_unit,
77 int communicator,
78 const bool shared
80{
82 return {nullptr, 0};
83}
84
85
87(
88 void *baseptr,
89 std::streamsize num_elements,
90 int disp_unit,
93{
95 return false;
96}
97
98
100(
101 void *baseptr,
102 std::streamsize num_elements,
103 int disp_unit,
104 int communicator
105)
106{
108 return false;
109}
110
111
112// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
115{}
116
118// * * * * * * * * * * * * * * * Synchronization * * * * * * * * * * * * * * //
119
122
123
126
127
128void Foam::UPstream::Window::mpi_win_locking(int rank, bool exclusive)
129{}
130
133{}
134
135
136// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
137
139(
140 void* origin,
141 std::streamsize count,
142 const UPstream::dataTypes dataTypeId,
143 int target_rank,
144 int target_disp
145) const
146{
148 return false;
149}
150
151
153(
154 const void* origin,
155 std::streamsize count,
156 const UPstream::dataTypes dataTypeId,
157 int target_rank,
158 int target_disp
159) const
160{
162 return false;
163}
164
165
167(
168 const UPstream::opCodes opCodeId,
169 const void* origin,
170 std::streamsize count,
171 const UPstream::dataTypes dataTypeId,
172 int target_rank,
173 int target_disp
174) const
175{
177 return false;
178}
179
180
182(
183 const UPstream::opCodes opCodeId,
184 const void* origin,
185 void* result,
186 const UPstream::dataTypes dataTypeId,
187 int target_rank,
188 int target_disp
189) const
190{
192 return false;
193}
194
195
196// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
197
198bool Foam::UPstream::Window::is_shared(const bool failNonShared) const
199{
200 return false;
201}
202
203
204std::pair<void*,int64_t>
206(
207 UPstream::Window window,
208 const int expected_disp_unit
209)
210{
211 // No window to query
213 return {nullptr, 0};
214}
215
216
217std::pair<void*,int64_t>
219(
220 UPstream::Window window,
221 int target_rank,
222 const int expected_disp_unit
223)
224{
225 // No window to query
227 return {nullptr, 0};
228}
229
230
231// ************************************************************************* //
An opaque wrapper for MPI_Comm with a vendor-independent representation without any <mpi....
Definition UPstream.H:2760
An opaque wrapper for MPI_Win with a vendor-independent representation and without any <mpi....
bool mpi_fetch_and_op(const UPstream::opCodes opCodeId, const void *origin, void *result, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
Retrieve the remote content (a single value) and then combine in new content.
static std::pair< void *, int64_t > mpi_win_query(UPstream::Window window, const int expected_disp_unit)
Retrieve window sizing information as address/count tuple. The expected sizeof(Type) is supplied as a...
Window() noexcept
Default construct as MPI_WIN_NULL.
void reset() noexcept
Reset to default constructed value (MPI_WIN_NULL).
std::pair< void *, int64_t > mpi_win_allocate(std::streamsize num_elements, int disp_unit, UPstream::Communicator communicator, const bool shared=false)
Allocate a local or shared memory window. Uses MPI_Win_allocate() or MPI_Win_allocate_shared(),...
bool get_data(void *origin, std::streamsize count, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
Get buffer contents from given rank.
bool put_data(const void *origin, std::streamsize count, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
Put buffer contents to given rank.
void mpi_win_unlocking(int rank)
Entry point to MPI_Win_unlock(), MPI_Win_unlock_all().
bool good() const noexcept
True if not equal to MPI_WIN_NULL.
void close()
MPI_Win_free(). Closes the window view and frees any associated memory,.
void mpi_win_locking(int rank, bool exclusive=false)
Entry point to MPI_Win_lock(), MPI_Win_lock_all(), optionally as exclusive lock.
bool mpi_win_create(void *baseptr, std::streamsize num_elements, int disp_unit, UPstream::Communicator communicator)
Create window onto existing memory with MPI_Win_create().
Window(const Window &) noexcept=default
Copy construct.
static std::pair< void *, int64_t > mpi_win_query_shared(UPstream::Window window, int target_rank, const int expected_disp_unit)
Retrieve shared window information as address/count tuple. The expected sizeof(Type) is supplied as a...
void sync()
MPI_Win_sync() - ignored if the window is not active.
bool is_shared(const bool failNonShared=false) const
Test if the window is a shared memory window.
void mpi_win_flushing(int rank, bool local=false)
Entry point to MPI_Win_flush(), MPI_Win_flush_all(), MPI_Win_flush_local(), MPI_Win_flush_local_all()...
int size() const
The number of ranks associated with the window group.
Wrapper for internally indexed communicator label. Always invokes UPstream::allocateCommunicatorCompo...
Definition UPstream.H:2546
opCodes
Mapping of some MPI op codes.
Definition UPstream.H:149
UPstream(const commsTypes commsType) noexcept
Construct for given communication type.
Definition UPstream.H:1184
dataTypes
Mapping of some fundamental and aggregate types to MPI data types.
Definition UPstream.H:107
bool local
Definition EEqn.H:20
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
const direction noexcept
Definition scalarImpl.H:265