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-2023 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 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::allocateCommunicatorComponents
79 (
80  const label,
81  const label
82 )
83 {}
84 
85 
86 void Foam::UPstream::freeCommunicatorComponents(const label)
87 {}
88 
89 
91 {}
92 
93 
94 std::pair<int,int>
96 (
97  const UPstream::commsTypes commsType,
98  const int fromProcNo,
99  const int tag,
100  const label communicator
101 )
102 {
103  return std::pair<int,int>(-1, 0);
104 }
105 
106 
107 // ************************************************************************* //
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
commsTypes
Communications types.
Definition: UPstream.H:72
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:598
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
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: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
An opaque wrapper for MPI_Request with a vendor-independent representation independent of any <mpi...
Definition: UPstream.H:1573
A HashTable similar to std::unordered_map.
Definition: HashTable.H:108
errorManip< error > abort(error &err)
Definition: errorManip.H:139
Wrapper class for allocating/freeing communicators. Always invokes allocateCommunicatorComponents() a...
Definition: UPstream.H:566
static void abort()
Call MPI_Abort with no other checks or cleanup.
Definition: UPstream.C:62
#define WarningInFunction
Report a warning using Foam::Warning.
static std::pair< int, int > probeMessage(const UPstream::commsTypes commsType, const int fromProcNo, const int tag=UPstream::msgType(), const label communicator=worldComm)
Probe for an incoming message.
Definition: UPstream.C:89
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
static void barrier(const label communicator, UPstream::Request *req=nullptr)
Impose a synchronisation barrier (optionally non-blocking)
Definition: UPstream.C:83