-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified TraceFunction object to require that an environment variable…
… be set to enable output. This makes it possible to leave the TraceFunction calls in while developing, but still be able to run and pass testing. Update TraceFunction for better formatting.
- Loading branch information
1 parent
45f5ee8
commit 5d51df4
Showing
10 changed files
with
534 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2009-2024 NTESS. Under the terms | ||
// of Contract DE-NA0003525 with NTESS, the U.S. | ||
// Government retains certain rights in this software. | ||
// | ||
// Copyright (c) 2009-2024, NTESS | ||
// All rights reserved. | ||
// | ||
// This file is part of the SST software package. For license | ||
// information, see the LICENSE file in the top level directory of the | ||
// distribution. | ||
|
||
//#include <assert.h> | ||
|
||
#include "sst_config.h" | ||
|
||
#include "sst/core/testElements/coreTest_Output.h" | ||
|
||
namespace SST { | ||
namespace CoreTestSerialization { | ||
|
||
|
||
void | ||
testTraceFunction(int level = 0) | ||
{ | ||
TraceFunction trace(CALL_INFO_LONG); | ||
trace.output("level = %d\n", level); | ||
|
||
if ( level == 0 ) { | ||
// for first level, output a string long enough that it goes | ||
// into the overflow case for the string generation in | ||
// TraceFunction::output(). The current overflow length is 200. | ||
int chars_in_line = 0; | ||
std::string str; | ||
for ( int i = 0; i < 250; ++i ) { | ||
str += std::to_string(i % 10); | ||
chars_in_line++; | ||
if ( chars_in_line == 40 ) { | ||
chars_in_line = 0; | ||
str += '\n'; | ||
} | ||
} | ||
trace.output("%s\n", str.c_str()); | ||
testTraceFunction(level + 1); | ||
} | ||
else if ( level == 1 || level == 2 ) { | ||
testTraceFunction(level + 1); | ||
} | ||
} | ||
|
||
coreTestOutput::coreTestOutput(ComponentId_t id, Params& params) : Component(id) | ||
{ | ||
Output& out = getSimulationOutput(); | ||
|
||
std::string test = params.find<std::string>("test"); | ||
if ( test == "" ) out.fatal(CALL_INFO_LONG, 1, "ERROR: Must specify test type\n"); | ||
|
||
if ( test == "TraceFunction" ) { testTraceFunction(); } | ||
} | ||
|
||
|
||
} // namespace CoreTestSerialization | ||
} // namespace SST |
Oops, something went wrong.