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