PstreamGlobals.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2018 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 "PstreamGlobals.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
36 
37 // Outstanding non-blocking operations.
41 
44 //int PstreamGlobals::nRequests_ = 0;
46 
47 // Free'd non-blocking operations.
49 //DynamicList<label> PstreamGlobals::freedRequests_;
51 
52 // Max outstanding message tag operations.
54 int PstreamGlobals::nTags_ = 0;
56 
57 // Free'd message tags
61 
62 
63 // Allocated communicators.
68 
70 (
71  const label comm,
72  const label otherProcNo
73 )
74 {
75  if
76  (
77  comm < 0
78  || comm >= PstreamGlobals::MPICommunicators_.size()
79  )
80  {
82  << "otherProcNo:" << otherProcNo << " : illegal communicator "
83  << comm << endl
84  << "Communicator should be within range 0.."
85  << PstreamGlobals::MPICommunicators_.size()-1 << abort(FatalError);
86  }
87 }
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 } // End namespace Foam
93 
94 // ************************************************************************* //
DynamicList< int > freedTags_
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
DynamicList< MPI_Request > outstandingRequests_
DynamicList< MPI_Group > MPIGroups_
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
errorManip< error > abort(error &err)
Definition: errorManip.H:131
DynamicList< MPI_Comm > MPICommunicators_
void checkCommunicator(const label, const label procNo)
Namespace for OpenFOAM.