hostCollatedFileOperation.H
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) 2017-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 Class
25  Foam::fileOperations::hostCollatedFileOperation
26 
27 Description
28  Version of collatedFileOperation with multiple read/write ranks.
29 
30  In parallel it will assume ranks are sorted according to hostname
31  and the lowest rank per hostname will be the IO rank. The output directories
32  will get a unique name processors<N>_<low>-<high> where N is the overall
33  number of processors and low and high is the range of ranks contained
34  in the files. Each of these subsets uses its own communicator.
35 
36  Instead of using the hostnames the IO ranks can be assigned using the
37  FOAM_IORANKS environment variable (also when running non-parallel), e.g.
38  when decomposing into 4:
39 
40  FOAM_IORANKS='(0 2)' decomposePar -fileHandler hostCollated
41 
42  will generate
43 
44  processors4_0-1/
45  containing data for processors 0 to 1
46  processors4_2-3/
47  containing data for processors 2 to 3
48 
49 See also
50  collatedFileOperation
51 
52 SourceFiles
53  hostCollatedFileOperation.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef fileOperations_hostCollatedFileOperation_H
58 #define fileOperations_hostCollatedFileOperation_H
59 
60 #include "collatedFileOperation.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace fileOperations
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class hostCollatedFileOperation Declaration
71 \*---------------------------------------------------------------------------*/
72 
74 :
76 {
77  // Private Member Functions
78 
79  //- Get the list of processors part of this set
80  static labelList subRanks(const label n);
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("hostCollated");
87 
88 
89  // Constructors
90 
91  //- Construct null
92  hostCollatedFileOperation(const bool verbose);
93 
94 
95  //- Destructor
97 };
98 
99 
100 /*---------------------------------------------------------------------------*\
101  Class hostCollatedFileOperationInitialise Declaration
102 \*---------------------------------------------------------------------------*/
105 :
107 {
108 public:
109 
110  // Constructors
111 
112  //- Construct from components
113  hostCollatedFileOperationInitialise(int& argc, char**& argv)
114  :
116  {}
117 
118 
119  //- Destructor
121  {}
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace fileOperations
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Version of collatedFileOperation with multiple read/write ranks.
TypeName("hostCollated")
Runtime type information.
hostCollatedFileOperation(const bool verbose)
Construct null.
Version of masterUncollatedFileOperation that collates regIOobjects into a container in the processor...
label n
Namespace for OpenFOAM.