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-2013 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 {
37  FatalErrorIn("UPstream::init(int& argc, char**& argv)")
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 {
48  notImplemented("UPstream::exit(int errnum)");
49 }
50 
51 
53 {
54  notImplemented("UPstream::abort()");
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 
84 void Foam::UPstream::allocatePstreamCommunicator
85 (
86  const label,
87  const label
88 )
89 {}
90 
91 
92 void Foam::UPstream::freePstreamCommunicator(const label)
93 {}
94 
95 
97 {
98  return 0;
99 }
100 
101 
103 {}
104 
105 
107 {}
108 
109 
111 {}
112 
113 
115 {
116  notImplemented("UPstream::finishedRequest()");
117  return false;
118 }
119 
120 
121 // ************************************************************************* //
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished?
Definition: UPstream.C:114
static void resetRequests(const label sz)
Truncate number of outstanding requests.
Definition: UPstream.C:102
An STL-conforming hash table.
Definition: HashTable.H:61
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
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
static void abort()
Abort program.
Definition: UPstream.C:52
static void exit(int errnum=1)
Exit program.
Definition: UPstream.C:46
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
Definition: UPstream.C:106
static const char nl
Definition: Ostream.H:260
static void addValidParOptions(HashTable< string > &validParOptions)
Add the valid option this type of communications library.
Definition: UPstream.C:31
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
static label nRequests()
Get number of outstanding requests.
Definition: UPstream.C:96
error FatalError
static void waitRequest(const label i)
Wait until request i has finished.
Definition: UPstream.C:110
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:356
void sumReduce(T &Value, label &Count, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
static bool init(int &argc, char **&argv)
Initialisation function called from main.
Definition: UPstream.C:35