30 template<
class KeyType,
class DataType>
38 template<
class KeyType,
class DataType>
46 template<
class KeyType,
class DataType>
49 const PrintTable<KeyType, DataType>& table
59 template<
class KeyType,
class DataType>
66 template<
class KeyType,
class DataType>
71 const bool printAverage
74 HashTable<HashTable<DataType, label>, KeyType> combinedTable;
78 procData[Pstream::myProcNo()] = table_;
80 Pstream::gatherList(procData);
82 if (Pstream::master())
84 label largestKeyLength = 6;
85 label largestDataLength = 0;
91 const HashTableData& procIData = procData[procI];
95 typename HashTableData::const_iterator iter = procIData.begin();
96 iter != procIData.end();
100 if (!combinedTable.found(iter.key()))
105 HashTable<DataType, label>()
109 HashTable<DataType, label>& key = combinedTable[iter.key()];
111 key.insert(procI, iter());
115 typename HashTable<DataType, label>
116 ::const_iterator dataIter = key.begin();
117 dataIter != key.end();
121 std::ostringstream buf;
124 largestDataLength =
max
127 label(buf.str().length())
131 std::ostringstream buf;
134 largestKeyLength =
max
137 label(buf.str().length())
142 os.width(largestKeyLength);
145 os.
width(largestKeyLength);
151 os.width(largestDataLength);
158 os.width(largestDataLength);
165 os.width(largestDataLength);
171 const List<KeyType>& sortedTable = combinedTable.sortedToc();
175 const HashTable<DataType, label>& procDataList
176 = combinedTable[sortedTable[keyI]];
178 os.width(largestKeyLength);
179 os <<
indent << sortedTable[keyI];
181 forAll(procDataList, elemI)
184 os.width(largestDataLength);
185 os << procDataList[elemI];
191 forAll(procDataList, elemI)
193 sum += procDataList[elemI];
197 os.width(largestDataLength);
203 os.width(largestDataLength);
204 os <<
sum/Pstream::nProcs();
216 template<
class KeyType,
class DataType>
219 const PrintTable<KeyType, DataType>& rhs
226 <<
"Attempted assignment to self"