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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2018 OpenFOAM Foundation
9  Copyright (C) 2016-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "Pstream.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
34 {}
35 
36 
38 {
40  << "The dummy Pstream library cannot be used in parallel mode"
41  << endl;
42 
43  return false;
44 }
45 
46 
47 bool Foam::UPstream::init(int& argc, char**& argv, const bool needsThread)
48 {
50  << "The dummy Pstream library cannot be used in parallel mode"
51  << endl
53 
54  return false;
55 }
56 
57 
58 void Foam::UPstream::shutdown(int errNo)
59 {}
60 
61 
62 void Foam::UPstream::exit(int errNo)
63 {
64  // No MPI - just exit
65  std::exit(errNo);
66 }
67 
68 
70 {
71  // No MPI - just abort
72  std::abort();
73 }
74 
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 void Foam::UPstream::allocatePstreamCommunicator
79 (
80  const label,
81  const label
82 )
83 {}
84 
85 
86 void Foam::UPstream::freePstreamCommunicator(const label)
87 {}
88 
89 
91 {
92  return 0;
93 }
94 
95 
96 void Foam::UPstream::resetRequests(const label n)
97 {}
98 
99 
100 void Foam::UPstream::waitRequests(const label start)
101 {}
102 
103 
104 void Foam::UPstream::waitRequest(const label i)
105 {}
106 
107 
108 bool Foam::UPstream::finishedRequest(const label i)
109 {
110  return true;
111 }
112 
113 
114 // ************************************************************************* //
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:578
static label nRequests() noexcept
Number of outstanding requests.
Definition: UPstream.C:83
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
static bool initNull()
Special purpose initialisation function.
Definition: UPstream.C:30
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished?
Definition: UPstream.C:101
static void shutdown(int errNo=0)
Shutdown (finalize) MPI as required.
Definition: UPstream.C:51
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
Definition: UPstream.C:55
static bool init(int &argc, char **&argv, const bool needsThread)
Initialisation function called from main.
Definition: UPstream.C:40
A HashTable similar to std::unordered_map.
Definition: HashTable.H:102
errorManip< error > abort(error &err)
Definition: errorManip.H:139
const direction noexcept
Definition: Scalar.H:258
static void resetRequests(const label n)
Truncate outstanding requests to given length.
Definition: UPstream.C:89
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
Definition: UPstream.C:93
static void abort()
Call MPI_Abort with no other checks or cleanup.
Definition: UPstream.C:62
#define WarningInFunction
Report a warning using Foam::Warning.
label n
static void waitRequest(const label i)
Wait until request i has finished.
Definition: UPstream.C:97
static void addValidParOptions(HashTable< string > &validParOptions)
Add the valid option this type of communications library adds/requires on the command line...
Definition: UPstream.C:26