PstreamCombineReduceOps.H
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-2013 OpenFOAM Foundation
9  Copyright (C) 2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
13 
14 Description
15  Compatibility include (AUG-2022).
16  Foam::combineReduce wrapper for Pstream::combineReduce
17 
18 \*---------------------------------------------------------------------------*/
19 
20 #ifndef FoamCompat_PstreamCombineReduceOps_H
21 #define FoamCompat_PstreamCombineReduceOps_H
22 
23 #include "Pstream.H"
24 #include "ops.H"
25 
26 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 namespace Foam
29 {
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 //- Compatibility wrapper for Pstream::combineReduce
34 template<class T, class CombineOp>
35 void combineReduce
36 (
37  T& value,
38  const CombineOp& cop,
39  const int tag = UPstream::msgType(),
40  const label comm = UPstream::worldComm
41 )
42 {
43  Pstream::combineReduce(value, cop, tag, comm);
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 } // End namespace Foam
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 #endif
54 
55 // ************************************************************************* //
void combineReduce(T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Compatibility wrapper for Pstream::combineReduce.
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:1229
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
Definition: UPstream.H:409
static void combineReduce(const List< commsStruct > &comms, T &value, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) applying cop to inplace combine value from different processors...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Namespace for OpenFOAM.