Loading...
Searching...
No Matches
UPstreamRequest.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) 2023-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 "UPstream.H"
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
34 UPstream::Request(nullptr)
35{}
36
37
38// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
41{
42 return false;
43}
44
45
47{}
48
49
50// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
51
52// Foam::UPstream::Request
53// Foam::UPstream::Request::lookup(const label req)
54// {
55// return UPstream::Request(nullptr);
56// }
57
59// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
61Foam::label Foam::UPstream::nRequests() noexcept { return 0; }
63void Foam::UPstream::resetRequests(const label n) {}
67void Foam::UPstream::cancelRequest(const label i) {}
71void Foam::UPstream::removeRequests(label pos, label len) {}
76void Foam::UPstream::waitRequests(label pos, label len) {}
78
79bool Foam::UPstream::waitAnyRequest(label pos, label len)
80{
81 return false;
82}
83
85(
86 label pos,
87 label len,
89)
90{
91 if (indices) indices->clear();
92 return false;
93}
94
96(
99)
100{
101 if (indices) indices->clear();
102 return false;
107 return -1;
108}
110void Foam::UPstream::waitRequest(const label i) {}
113bool Foam::UPstream::activeRequest(const label i) { return false; }
114bool Foam::UPstream::activeRequest(const UPstream::Request&) { return false; }
115
116bool Foam::UPstream::finishedRequest(const label i) { return true; }
117bool Foam::UPstream::finishedRequest(UPstream::Request&) { return true; }
119bool Foam::UPstream::finishedRequests(label pos, label len)
120{
121 return true;
122}
123
126{
127 return true;
128}
129
130
131bool Foam::UPstream::finishedRequestPair(label& req0, label& req1)
133 req0 = -1;
134 req1 = -1;
135 return true;
136}
137
138
139void Foam::UPstream::waitRequestPair(label& req0, label& req1)
140{
141 req0 = -1;
142 req1 = -1;
143}
144
145
146// ************************************************************************* //
label n
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
An opaque wrapper for MPI_Request with a vendor-independent representation without any <mpi....
Definition UPstream.H:2919
Request(const Request &) noexcept=default
Copy construct.
void reset() noexcept
Reset to default constructed value (MPI_REQUEST_NULL).
bool good() const noexcept
True if not equal to MPI_REQUEST_NULL.
Request() noexcept
Default construct as MPI_REQUEST_NULL.
static void freeRequest(UPstream::Request &req)
Non-blocking comms: free outstanding request. Corresponds to MPI_Request_free().
static bool waitSomeRequests(label pos, label len=-1, DynamicList< int > *indices=nullptr)
Wait until some requests (from position onwards) have finished. Corresponds to MPI_Waitsome().
static bool finishedRequests(label pos, label len=-1)
Non-blocking comms: have all requests (from position onwards) finished? Corresponds to MPI_Testall().
static void addRequest(UPstream::Request &req)
Transfer the (wrapped) MPI request to the internal global list and invalidate the parameter (ignores ...
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
static void cancelRequest(const label i)
Non-blocking comms: cancel and free outstanding request. Corresponds to MPI_Cancel() + MPI_Request_fr...
static void resetRequests(const label n)
Truncate outstanding requests to given length, which is expected to be in the range [0 to nRequests()...
static void freeRequests(UList< UPstream::Request > &requests)
Non-blocking comms: free outstanding requests. Corresponds to MPI_Request_free().
static bool finishedRequestPair(label &req0, label &req1)
Non-blocking comms: have both requests finished? Corresponds to pair of MPI_Test().
static void cancelRequests(UList< UPstream::Request > &requests)
Non-blocking comms: cancel and free outstanding requests. Corresponds to MPI_Cancel() + MPI_Request_f...
static bool waitAnyRequest(label pos, label len=-1)
Wait until any request (from position onwards) has finished. Corresponds to MPI_Waitany().
static void removeRequests(label pos, label len=-1)
Non-blocking comms: cancel/free outstanding requests (from position onwards) and remove from internal...
static void waitRequestPair(label &req0, label &req1)
Non-blocking comms: wait for both requests to finish. Corresponds to pair of MPI_Wait().
static void waitRequests()
Wait for all requests to finish.
Definition UPstream.H:2497
UPstream(const commsTypes commsType) noexcept
Construct for given communication type.
Definition UPstream.H:1184
static bool activeRequest(const label i)
Is request i active (!= MPI_REQUEST_NULL)?
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished? Corresponds to MPI_Test().
static void waitRequest(const label i)
Wait until request i has finished. Corresponds to MPI_Wait().
dimensionedScalar pos(const dimensionedScalar &ds)
const direction noexcept
Definition scalarImpl.H:265