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-2025 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 "UPstream.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 bool Foam::UPstream::setSharedMemoryCommunicators()
59 {
60  return false;
61 }
62 
63 
64 void Foam::UPstream::shutdown(int errNo)
65 {}
66 
67 
68 void Foam::UPstream::exit(int errNo)
69 {
70  // No MPI - just exit
71  std::exit(errNo);
72 }
73 
74 
75 void Foam::UPstream::abort(int errNo)
76 {
77  // No MPI - just abort
78  std::abort();
79 }
80 
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 void Foam::UPstream::allocateCommunicatorComponents
85 (
86  const label parentIndex,
87  const label index
88 )
89 {}
90 
91 
92 void Foam::UPstream::dupCommunicatorComponents
93 (
94  const label parentIndex,
95  const label index
96 )
97 {}
98 
99 void Foam::UPstream::splitCommunicatorComponents
100 (
101  const label parentIndex,
102  const label index,
103  int colour,
104  const bool two_step
105 )
106 {}
107 
108 
109 void Foam::UPstream::freeCommunicatorComponents(const label index)
110 {}
112 
114 {}
115 
116 
118 (
119  const int toProc,
120  const int communicator,
121  const int tag
122 )
123 {}
124 
125 
127 (
128  const int fromProc,
129  const int communicator,
130  const int tag
131 )
132 {
133  return -1;
134 }
135 
136 
137 std::pair<int,int64_t>
139 (
140  const UPstream::commsTypes commsType,
141  const int fromProcNo,
142  const int tag,
143  const int communicator
144 )
145 {
146  return {-1, 0};
147 }
148 
149 
150 // ************************************************************************* //
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
commsTypes
Communications types.
Definition: UPstream.H:77
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:600
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:529
static bool initNull()
Special purpose initialisation function.
Definition: UPstream.C:30
static void shutdown(int errNo=0)
Shutdown (finalize) MPI as required.
Definition: UPstream.C:57
static void send_done(const int toProcNo, const int communicator, const int tag=UPstream::msgType()+1970)
Impose a point-to-point synchronisation barrier by sending a zero-byte "done" message to given rank...
Definition: UPstream.C:111
static void barrier(const int communicator, UPstream::Request *req=nullptr)
Impose a synchronisation barrier (optionally non-blocking)
Definition: UPstream.C:106
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
Definition: UPstream.C:61
static bool init(int &argc, char **&argv, const bool needsThread)
Initialisation function called from main.
Definition: UPstream.C:40
An opaque wrapper for MPI_Request with a vendor-independent representation without any <mpi...
Definition: UPstream.H:2599
A HashTable similar to std::unordered_map.
Definition: HashTable.H:108
errorManip< error > abort(error &err)
Definition: errorManip.H:139
static std::pair< int, int64_t > probeMessage(const UPstream::commsTypes commsType, const int fromProcNo, const int tag=UPstream::msgType(), const int communicator=worldComm)
Probe for an incoming message.
Definition: UPstream.C:132
Wrapper for internally indexed communicator label. Always invokes UPstream::allocateCommunicatorCompo...
Definition: UPstream.H:2237
static int wait_done(const int fromProcNo, const int communicator, const int tag=UPstream::msgType()+1970)
Impose a point-to-point synchronisation barrier by receiving a zero-byte "done" message from given ra...
Definition: UPstream.C:120
#define WarningInFunction
Report a warning using Foam::Warning.
static void abort(int errNo=1)
Call MPI_Abort with no other checks or cleanup.
Definition: UPstream.C:68
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