Repository navigation
Expand file tree
/
Copy pathoutput.cpp
More file actions
507 lines (455 loc) · 18.9 KB
/
Copy pathoutput.cpp
File metadata and controls
507 lines (455 loc) · 18.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
/*
* SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "cuda_version_check.h"
#include "inline_common.h"
#include "nvbandwidth_version.h"
#include "output.h"
#include <math.h>
#ifdef MULTINODE
#include <mpi.h>
#endif
void Output::addVersionInfo() {
OUTPUT << "nvbandwidth Version: " << NVBANDWIDTH_VERSION << "\n";
OUTPUT << "Built from Git version: " << GIT_VERSION << "\n\n";
#ifdef MULTINODE
char MPIVersion[MPI_MAX_LIBRARY_VERSION_STRING];
int MPIVersionLen;
MPI_Get_library_version(MPIVersion, &MPIVersionLen);
OUTPUT << "MPI version: " << MPIVersion << "\n";
#endif
}
void Output::printInfo() {
OUTPUT << "NOTE: The reported results may not reflect the full capabilities of the platform.\n"
<< "Performance can vary with software drivers, hardware clocks, and system topology.\n\n";
}
void Output::addCudaAndDriverInfo(int cudaRuntimeVersion, int cudaDriverApiVersion,
const std::string &nvmlDriverVersion) {
OUTPUT << "CUDA Runtime Version: " << formatCudaVersionCode(cudaRuntimeVersion) << " ("
<< cudaRuntimeVersion << ")" << "\n";
OUTPUT << "CUDA Driver Version (API): " << formatCudaVersionCode(cudaDriverApiVersion) << " ("
<< cudaDriverApiVersion << ")" << "\n";
OUTPUT << "Driver Version: " << nvmlDriverVersion << "\n\n";
}
void Output::addConfComputeInfo(bool bounceBufferConfComputeEnabled) {
if (bounceBufferConfComputeEnabled) {
OUTPUT << "Detected platform using encrypted bounce buffers for CPU<->GPU traffic.\n\n";
}
}
void Output::recordError(const std::string &error) {
std::cerr << error << std::endl;
}
void Output::recordError(const std::vector<std::string> &errorParts) {
bool first = true;
for (auto &part : errorParts) {
if (first) {
OUTPUT << part << ":\n\n";
first = false;
} else {
OUTPUT << part << "\n";
}
}
}
void Output::listTestcases(const std::vector<Testcase*> &testcases) {
size_t numTestcases = testcases.size();
OUTPUT << "Index, Name:\n\tDescription\n";
for (size_t i = 0; i < numTestcases; i++) {
OUTPUT << i << ", " << testcases[i]->testKey() << ":\n\t" << testcases[i]->testDesc() << "\n";
}
}
std::string getDeviceDisplayInfo(int deviceOrdinal) {
std::stringstream sstream;
CUdevice dev;
char name[STRING_LENGTH];
int busId, deviceId, domainId;
CUdevice device;
CU_ASSERT(cuDeviceGet(&dev, deviceOrdinal));
CU_ASSERT(cuDeviceGetName(name, sizeof(name), dev));
CU_ASSERT(cuDeviceGetAttribute(&domainId, CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, dev));
CU_ASSERT(cuDeviceGetAttribute(&busId, CU_DEVICE_ATTRIBUTE_PCI_BUS_ID, dev));
CU_ASSERT(cuDeviceGetAttribute(&deviceId, CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID, dev));
sstream << name << " (" <<
std::hex << std::setw(8) << std::setfill('0') << domainId << ":" <<
std::hex << std::setw(2) << std::setfill('0') << busId << ":" <<
std::hex << std::setw(2) << std::setfill('0') << deviceId << ")" <<
std::dec << std::setfill(' ') << std::setw(0); // reset formatting
return sstream.str();
}
#ifdef MULTINODE
std::string formatFabricCliqueType(FabricCliqueType type) {
switch (type) {
case FabricCliqueType::UnicastPointer:
return "UNICAST_POINTER";
case FabricCliqueType::MulticastPointer:
return "MULTICAST_POINTER";
case FabricCliqueType::UnicastLogicalEndpoint:
return "UNICAST_LOGICAL_ENDPOINT";
case FabricCliqueType::MulticastLogicalEndpoint:
return "MULTICAST_LOGICAL_ENDPOINT";
default:
return "UNKNOWN(" + std::to_string(static_cast<unsigned int>(type)) + ")";
}
}
static std::string formatFabricUuid(const unsigned char uuid[kFabricClusterUuidBytes]) {
std::stringstream s;
for (unsigned int i = 0; i < kFabricClusterUuidBytes; i++) {
s << std::hex << std::setw(2) << std::setfill('0') << static_cast<unsigned int>(uuid[i]);
}
return s.str();
}
static std::string formatFabricCliques(const RankFabricInfo &info) {
std::stringstream s;
s << "{";
const unsigned int count = std::min(info.numCliques, kMaxRankFabricCliques);
for (unsigned int i = 0; i < count; i++) {
if (i > 0) {
s << ", ";
}
s << formatFabricCliqueType(info.cliques[i].type) << ":" << info.cliques[i].id;
}
if (info.reportedNumCliques > info.numCliques) {
if (count > 0) {
s << ", ";
}
s << "... reported=" << info.reportedNumCliques
<< ", max=" << kMaxRankFabricCliques;
}
s << "}";
return s.str();
}
#ifdef NVBW_HAVE_NVML_GPU_FABRIC_INFO
static const char *fabricStateToString(unsigned int state) {
switch (state) {
case NVML_GPU_FABRIC_STATE_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_STATE_NOT_STARTED:
return "NOT_STARTED";
case NVML_GPU_FABRIC_STATE_IN_PROGRESS:
return "IN_PROGRESS";
case NVML_GPU_FABRIC_STATE_COMPLETED:
return "COMPLETED";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthSummaryToString(unsigned char healthSummary) {
switch (healthSummary) {
case NVML_GPU_FABRIC_HEALTH_SUMMARY_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_SUMMARY_HEALTHY:
return "HEALTHY";
case NVML_GPU_FABRIC_HEALTH_SUMMARY_UNHEALTHY:
return "UNHEALTHY";
case NVML_GPU_FABRIC_HEALTH_SUMMARY_LIMITED_CAPACITY:
return "LIMITED_CAPACITY";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthDegradedBwToString(unsigned int value) {
switch (value) {
case NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_TRUE:
return "TRUE";
case NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_FALSE:
return "FALSE";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthRouteRecoveryToString(unsigned int value) {
switch (value) {
case NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_TRUE:
return "TRUE";
case NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_FALSE:
return "FALSE";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthRouteUnhealthyToString(unsigned int value) {
switch (value) {
case NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_TRUE:
return "TRUE";
case NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_FALSE:
return "FALSE";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthAccessTimeoutRecoveryToString(unsigned int value) {
switch (value) {
case NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_TRUE:
return "TRUE";
case NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_FALSE:
return "FALSE";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthIncorrectConfigurationToString(unsigned int value) {
switch (value) {
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NONE:
return "NONE";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INCORRECT_SYSGUID:
return "INCORRECT_SYSGUID";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INCORRECT_CHASSIS_SN:
return "INCORRECT_CHASSIS_SN";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NO_PARTITION:
return "NO_PARTITION";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INSUFFICIENT_NVLINKS:
return "INSUFFICIENT_NVLINKS";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INCOMPATIBLE_GPU_FW:
return "INCOMPATIBLE_GPU_FW";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_INVALID_LOCATION:
return "INVALID_LOCATION";
case NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_GPU_STATE_INVALID:
return "GPU_STATE_INVALID";
default:
return "UNKNOWN";
}
}
static const char *fabricHealthPartitionAssignedToString(unsigned int value) {
switch (value) {
case NVML_GPU_FABRIC_HEALTH_MASK_PARTITION_ASSIGNED_NOT_SUPPORTED:
return "NOT_SUPPORTED";
case NVML_GPU_FABRIC_HEALTH_MASK_PARTITION_ASSIGNED_TRUE:
return "TRUE";
case NVML_GPU_FABRIC_HEALTH_MASK_PARTITION_ASSIGNED_FALSE:
return "FALSE";
default:
return "UNKNOWN";
}
}
static void appendFabricHealthIssue(std::stringstream &s, bool &hasIssue,
const std::string &name, const char *value) {
if (hasIssue) {
s << ", ";
}
s << name << "=" << value;
hasIssue = true;
}
static std::string formatFabricHealthIssues(unsigned int healthMask) {
std::stringstream s;
bool hasIssue = false;
const unsigned int degradedBw = NVML_GPU_FABRIC_HEALTH_GET(healthMask, _DEGRADED_BW);
if (degradedBw == NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_TRUE ||
(degradedBw != NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_FALSE &&
degradedBw != NVML_GPU_FABRIC_HEALTH_MASK_DEGRADED_BW_NOT_SUPPORTED)) {
appendFabricHealthIssue(s, hasIssue, "degradedBw", fabricHealthDegradedBwToString(degradedBw));
}
const unsigned int routeRecovery = NVML_GPU_FABRIC_HEALTH_GET(healthMask, _ROUTE_RECOVERY);
if (routeRecovery == NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_TRUE ||
(routeRecovery != NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_FALSE &&
routeRecovery != NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_RECOVERY_NOT_SUPPORTED)) {
appendFabricHealthIssue(s, hasIssue, "routeRecovery", fabricHealthRouteRecoveryToString(routeRecovery));
}
const unsigned int routeUnhealthy = NVML_GPU_FABRIC_HEALTH_GET(healthMask, _ROUTE_UNHEALTHY);
if (routeUnhealthy == NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_TRUE ||
(routeUnhealthy != NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_FALSE &&
routeUnhealthy != NVML_GPU_FABRIC_HEALTH_MASK_ROUTE_UNHEALTHY_NOT_SUPPORTED)) {
appendFabricHealthIssue(s, hasIssue, "routeUnhealthy", fabricHealthRouteUnhealthyToString(routeUnhealthy));
}
const unsigned int accessTimeoutRecovery = NVML_GPU_FABRIC_HEALTH_GET(healthMask, _ACCESS_TIMEOUT_RECOVERY);
if (accessTimeoutRecovery == NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_TRUE ||
(accessTimeoutRecovery != NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_FALSE &&
accessTimeoutRecovery != NVML_GPU_FABRIC_HEALTH_MASK_ACCESS_TIMEOUT_RECOVERY_NOT_SUPPORTED)) {
appendFabricHealthIssue(s, hasIssue, "accessTimeoutRecovery",
fabricHealthAccessTimeoutRecoveryToString(accessTimeoutRecovery));
}
const unsigned int incorrectConfiguration = NVML_GPU_FABRIC_HEALTH_GET(healthMask, _INCORRECT_CONFIGURATION);
if (incorrectConfiguration != NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NONE &&
incorrectConfiguration != NVML_GPU_FABRIC_HEALTH_MASK_INCORRECT_CONFIGURATION_NOT_SUPPORTED) {
appendFabricHealthIssue(s, hasIssue, "incorrectConfiguration",
fabricHealthIncorrectConfigurationToString(incorrectConfiguration));
}
const unsigned int partitionAssigned = NVML_GPU_FABRIC_HEALTH_GET(healthMask, _PARTITION_ASSIGNED);
if (partitionAssigned == NVML_GPU_FABRIC_HEALTH_MASK_PARTITION_ASSIGNED_FALSE ||
(partitionAssigned != NVML_GPU_FABRIC_HEALTH_MASK_PARTITION_ASSIGNED_TRUE &&
partitionAssigned != NVML_GPU_FABRIC_HEALTH_MASK_PARTITION_ASSIGNED_NOT_SUPPORTED)) {
appendFabricHealthIssue(s, hasIssue, "partitionAssigned",
fabricHealthPartitionAssignedToString(partitionAssigned));
}
if (!hasIssue) {
return "";
}
return "{" + s.str() + "}";
}
static bool hasUnhealthyFabricHealth(const RankFabricInfo &info) {
if (info.infoSource != RankFabricInfoSource::Nvml) {
return false;
}
if (!formatFabricHealthIssues(info.healthMask).empty()) {
return true;
}
return info.healthSummary != NVML_GPU_FABRIC_HEALTH_SUMMARY_HEALTHY &&
info.healthSummary != NVML_GPU_FABRIC_HEALTH_SUMMARY_NOT_SUPPORTED;
}
#endif
std::string formatRankFabricInfo(const RankFabricInfo &info) {
std::stringstream s;
s << "rank " << info.rank << " (" << info.hostname << "), device " << info.localDevice;
if (info.infoSource == RankFabricInfoSource::None) {
s << ": fabric query unavailable: no provider";
return s.str();
}
if (!info.runtimeSymbolAvailable) {
if (info.infoSource == RankFabricInfoSource::Nvml) {
s << ": NVML fabric query unavailable";
} else {
s << ": CUDA fabric clique query unavailable";
}
return s.str();
}
if (info.infoSource == RankFabricInfoSource::Nvml) {
#ifdef NVBW_HAVE_NVML_GPU_FABRIC_INFO
if (info.queryResult != NVML_SUCCESS) {
s << ": NVML fabric query failed: "
<< nvmlErrorString(static_cast<nvmlReturn_t>(info.queryResult));
return s.str();
}
s << ": fabricUuid=" << formatFabricUuid(info.clusterUuid)
<< ", cliques=" << formatFabricCliques(info)
<< ", state=" << fabricStateToString(info.state);
if (info.state == NVML_GPU_FABRIC_STATE_COMPLETED) {
s << ", status=" << nvmlErrorString(static_cast<nvmlReturn_t>(info.fabricStatus));
}
s << ", health=" << fabricHealthSummaryToString(info.healthSummary);
std::string healthIssues = formatFabricHealthIssues(info.healthMask);
if (!healthIssues.empty() ||
(info.healthSummary != NVML_GPU_FABRIC_HEALTH_SUMMARY_HEALTHY &&
info.healthSummary != NVML_GPU_FABRIC_HEALTH_SUMMARY_NOT_SUPPORTED)) {
s << ", healthMask=0x" << std::hex << info.healthMask << std::dec;
if (!healthIssues.empty()) {
s << ", healthIssues=" << healthIssues;
}
}
return s.str();
#else
s << ": NVML fabric query unavailable";
return s.str();
#endif
}
if (info.queryResult != CUDA_SUCCESS) {
const char *errorName = nullptr;
const char *errorString = nullptr;
cuGetErrorName(static_cast<CUresult>(info.queryResult), &errorName);
cuGetErrorString(static_cast<CUresult>(info.queryResult), &errorString);
s << ": CUDA fabric clique query failed: "
<< (errorName != nullptr ? errorName : "CUDA_ERROR_UNKNOWN");
if (errorString != nullptr) {
s << " (" << errorString << ")";
}
return s.str();
}
s << ": fabricUuid=" << formatFabricUuid(info.clusterUuid)
<< ", cliques=" << formatFabricCliques(info);
return s.str();
}
#endif
void Output::recordDevices(int deviceCount) {
OUTPUT << env->getHostname() << "\n";
for (int iDev = 0; iDev < deviceCount; iDev++) {
OUTPUT << "Device " << iDev << ": " << getDeviceDisplayInfo(iDev) << "\n";
}
OUTPUT << "\n";
}
#ifdef MULTINODE
void Output::recordMultinodeDevices(const std::vector<RankDeviceInfo> &rankDevices) {
for (const RankDeviceInfo &info : rankDevices) {
OUTPUT << formatRankDeviceInfo(info) << "\n";
}
OUTPUT << "\n";
}
void Output::recordGpuFabricInfo(const std::vector<RankFabricInfo> &fabricInfo) {
if (gSettings.outputFormat != "text") {
return;
}
bool hasFabricInfo = false;
for (const RankFabricInfo &info : fabricInfo) {
if (info.runtimeSymbolAvailable) {
hasFabricInfo = true;
break;
}
}
if (!hasFabricInfo) {
return;
}
OUTPUT << "Fabric cluster, clique info:\n";
for (const RankFabricInfo &info : fabricInfo) {
OUTPUT << formatRankFabricInfo(info) << "\n";
}
#ifdef NVBW_HAVE_NVML_GPU_FABRIC_INFO
bool hasUnhealthyFabricNode = false;
for (const RankFabricInfo &info : fabricInfo) {
if (info.runtimeSymbolAvailable &&
info.queryResult == NVML_SUCCESS &&
hasUnhealthyFabricHealth(info)) {
hasUnhealthyFabricNode = true;
break;
}
}
if (hasUnhealthyFabricNode) {
recordWarning("\nUnhealthy fabric nodes:");
for (const RankFabricInfo &info : fabricInfo) {
if (info.runtimeSymbolAvailable &&
info.queryResult == NVML_SUCCESS &&
hasUnhealthyFabricHealth(info)) {
recordWarning(formatRankFabricInfo(info));
}
}
}
#endif
OUTPUT << "\n";
}
#endif
void Output::addTestcase(const std::string &name, const std::string &status, const std::string &msg) {
if (status == NVB_RUNNING) {
OUTPUT << status << " " << name << ".\n";
} else {
OUTPUT << status << " " << name << ": " << msg << "\n";
}
}
void Output::setTestcaseStatusAndAddIfNeeded(const std::string &name, const std::string &status, const std::string &msg) {
// For plain text output, the name has always been printed already and therefore isn't needed here
OUTPUT << status << ": " << msg << "\n";
}
void Output::addTestcaseResults(const PeerValueMatrix<double> &bandwidthValues, const std::string &description) {
OUTPUT << description << "\n";
OUTPUT << std::fixed << std::setprecision(2) << bandwidthValues << "\n";
OUTPUT << std::flush;
}
void Output::print() {
// NO-OP
}
void Output::recordErrorCurrentTest(const std::string &errorLine1, const std::string &errorLine2) {
OUTPUT << errorLine1 << "\n" << errorLine2 << "\n";
}
void Output::recordWarning(const std::string &warning) {
OUTPUT << warning << "\n";
}
void RecordError(const std::stringstream &errmsg) {
output->recordError(errmsg.str());
}