TPIE

2362a60
sort_parameters.h
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2012, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
20 #ifndef __TPIE_PIPELINING_SORT_PARAMETERS_H__
21 #define __TPIE_PIPELINING_SORT_PARAMETERS_H__
22 
23 #include <tpie/types.h>
24 #include <iostream>
25 
26 namespace tpie {
27 
30  memory_size_type filesPhase1;
32  memory_size_type memoryPhase1;
34  memory_size_type filesPhase2;
36  memory_size_type memoryPhase2;
38  memory_size_type filesPhase3;
40  memory_size_type memoryPhase3;
46  memory_size_type runLength;
49  memory_size_type internalReportThreshold;
51  memory_size_type fanout;
53  memory_size_type finalFanout;
54 
55  void dump(std::ostream & out) const {
56  out << "Merge sort parameters\n"
57  << "Phase 1 files: " << filesPhase1 << '\n'
58  << "Phase 1 memory: " << memoryPhase1 << '\n'
59  << "Run length: " << runLength << '\n'
60  << "Phase 2 files: " << filesPhase2 << '\n'
61  << "Phase 2 memory: " << memoryPhase2 << '\n'
62  << "Fanout: " << fanout << '\n'
63  << "Phase 3 files: " << filesPhase3 << '\n'
64  << "Phase 3 memory: " << memoryPhase3 << '\n'
65  << "Final merge level fanout: " << finalFanout << '\n'
66  << "Internal report threshold: " << internalReportThreshold << '\n';
67  }
68 };
69 
70 } // namespace tpie
71 
72 #endif // __TPIE_PIPELINING_SORT_PARAMETERS_H__
memory_size_type runLength
Run length, subject to memory restrictions during phase 2.
Typesafe bitflags.
memory_size_type filesPhase3
files available during output phase.
memory_size_type internalReportThreshold
Maximum item count for internal reporting, subject to memory restrictions in all phases.
memory_size_type memoryPhase3
Memory available during output phase.
memory_size_type filesPhase2
files available while merging runs.
memory_size_type finalFanout
Fanout of merge tree during phase 3.
memory_size_type memoryPhase2
Memory available while merging runs.
memory_size_type filesPhase1
files available while forming sorted runs.
memory_size_type fanout
Fanout of merge tree during phase 2.
memory_size_type memoryPhase1
memory available while forming sorted runs.