UPstream.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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "UPstream.H"
27 #include "PstreamReduceOps.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
32 {}
33 
34 
35 bool Foam::UPstream::init(int& argc, char**& argv)
36 {
38  << "Trying to use the dummy Pstream library." << nl
39  << "This dummy library cannot be used in parallel mode"
41 
42  return false;
43 }
44 
45 
46 void Foam::UPstream::exit(int errnum)
47 {
49 }
50 
51 
53 {
55 }
56 
57 
58 void Foam::reduce(scalar&, const sumOp<scalar>&, const int, const label)
59 {}
60 
61 
62 void Foam::reduce(scalar&, const minOp<scalar>&, const int, const label)
63 {}
64 
65 
66 void Foam::reduce(vector2D&, const sumOp<vector2D>&, const int, const label)
67 {}
68 
69 
70 void Foam::sumReduce
71 (
72  scalar&,
73  label&,
74  const int,
75  const label
76 )
77 {}
78 
79 
80 void Foam::reduce(scalar&, const sumOp<scalar>&, const int, const label, label&)
81 {}
82 
83 
85 (
86  const labelUList& sendData,
87  labelUList& recvData,
88  const label communicator
89 )
90 {
91  recvData.deepCopy(sendData);
92 }
93 
94 
95 void Foam::UPstream::allocatePstreamCommunicator
96 (
97  const label,
98  const label
99 )
100 {}
101 
102 
103 void Foam::UPstream::freePstreamCommunicator(const label)
104 {}
105 
106 
108 {
109  return 0;
110 }
111 
112 
114 {}
115 
116 
118 {}
119 
120 
122 {}
123 
124 
126 {
128  return false;
129 }
130 
131 
132 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Inter-processor communication reduction functions.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished?
Definition: UPstream.C:125
static label nRequests()
Get number of outstanding requests.
Definition: UPstream.C:107
void deepCopy(const UList< T > &)
Copy elements of the given UList.
Definition: UList.C:35
void sumReduce(T &Value, label &Count, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
static void resetRequests(const label sz)
Truncate number of outstanding requests.
Definition: UPstream.C:113
static bool init(int &argc, char **&argv)
Initialisation function called from main.
Definition: UPstream.C:35
An STL-conforming hash table.
Definition: HashTable.H:61
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
static void exit(int errnum=1)
Exit program.
Definition: UPstream.C:46
static const char nl
Definition: Ostream.H:262
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
Definition: UPstream.C:117
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static void abort()
Abort program.
Definition: UPstream.C:52
static void allToAll(const labelUList &sendData, labelUList &recvData, const label communicator=0)
Exchange label with all processors (in the communicator).
Definition: UPstream.C:85
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
static void waitRequest(const label i)
Wait until request i has finished.
Definition: UPstream.C:121
static void addValidParOptions(HashTable< string > &validParOptions)
Add the valid option this type of communications library.
Definition: UPstream.C:31