hostCollatedFileOperation.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) 2017-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fileOperations::hostCollatedFileOperation
28 
29 Description
30  Version of collatedFileOperation with multiple read/write ranks.
31 
32  In parallel it will assume ranks are sorted according to hostname
33  and the lowest rank per hostname will be the IO rank. The output directories
34  will get a unique name processors<N>_<low>-<high> where N is the
35  overall number of processors and low and high is the range of ranks
36  contained in the files. Each of these subsets uses its own communicator.
37 
38  Instead of using the hostnames the IO ranks can be assigned using the
39  FOAM_IORANKS environment variable (also when running non-parallel), e.g.
40  when decomposing into 4:
41 
42  FOAM_IORANKS='(0 2)' decomposePar -fileHandler hostCollated
43 
44  will generate
45 
46  processors4_0-1/
47  containing data for processors 0 to 1
48  processors4_2-3/
49  containing data for processors 2 to 3
50 
51 See also
52  collatedFileOperation
53 
54 SourceFiles
55  hostCollatedFileOperation.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef fileOperations_hostCollatedFileOperation_H
60 #define fileOperations_hostCollatedFileOperation_H
61 
62 #include "collatedFileOperation.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace fileOperations
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class hostCollatedFileOperation Declaration
73 \*---------------------------------------------------------------------------*/
74 
76 :
78 {
79  // Private Member Functions
80 
81  //- Get the list of processors part of this set
82  static labelList subRanks(const label n);
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("hostCollated");
89 
90 
91  // Constructors
92 
93  //- Construct null
94  hostCollatedFileOperation(const bool verbose);
95 
96 
97  //- Destructor
99 };
100 
101 
102 /*---------------------------------------------------------------------------*\
103  Class hostCollatedFileOperationInitialise Declaration
104 \*---------------------------------------------------------------------------*/
105 
107 :
109 {
110 public:
111 
112  // Constructors
113 
114  //- Construct from components
115  hostCollatedFileOperationInitialise(int& argc, char**& argv)
116  :
118  {}
119 
120 
121  //- Destructor
122  virtual ~hostCollatedFileOperationInitialise() = default;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace fileOperations
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
collatedFileOperation.H
Foam::fileOperations::hostCollatedFileOperation::TypeName
TypeName("hostCollated")
Runtime type information.
Foam::fileOperations::hostCollatedFileOperation::hostCollatedFileOperation
hostCollatedFileOperation(const bool verbose)
Construct null.
Definition: hostCollatedFileOperation.C:129
Foam::fileOperations::hostCollatedFileOperationInitialise::~hostCollatedFileOperationInitialise
virtual ~hostCollatedFileOperationInitialise()=default
Destructor.
Foam::fileOperations::hostCollatedFileOperation
Version of collatedFileOperation with multiple read/write ranks.
Definition: hostCollatedFileOperation.H:74
Foam::fileOperations::hostCollatedFileOperationInitialise::hostCollatedFileOperationInitialise
hostCollatedFileOperationInitialise(int &argc, char **&argv)
Construct from components.
Definition: hostCollatedFileOperation.H:114
Foam::fileOperations::hostCollatedFileOperationInitialise
Definition: hostCollatedFileOperation.H:105
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::fileOperations::hostCollatedFileOperation::~hostCollatedFileOperation
virtual ~hostCollatedFileOperation()
Destructor.
Definition: hostCollatedFileOperation.C:171
Foam::fileOperations::collatedFileOperation
Version of masterUncollatedFileOperation that collates regIOobjects into a container in the processor...
Definition: collatedFileOperation.H:61
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileOperations::collatedFileOperationInitialise
Definition: collatedFileOperation.H:175
Foam::List< label >