Skip to content

Commit

Permalink
Revert debug file to be a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Feb 25, 2024
1 parent 85a4b3b commit dd89a15
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 44 deletions.
2 changes: 0 additions & 2 deletions doc/output-details-and-examples/src/output-files.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ \chapter{Output Files}\label{output-files}

\input{src/output-files/eplusout-dbg}

\input{src/output-files/eplusout-dbl}

\input{src/output-files/eplusout-dxf}

\input{src/output-files/eplusout-edd}
Expand Down
12 changes: 12 additions & 0 deletions doc/output-details-and-examples/src/output-files/eplusout-dbg.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ \section{eplusout.dbg}\label{eplusout.dbg}

The standard debug output appears like this:

node \#~~ Node Type~~ Name

~~ 1~~~~~~~~~~~ Air~~~~~~~~~ T1

~~ 2~~~~~~~~~~~ Air~~~~~~~~~ ZONE 2 INLET NODE

~~ 3~~~~~~~~~~~ Air~~~~~~~~~ ZONE 3 INLET NODE

~~ 4~~~~~~~~~~~ Air~~~~~~~~~ AIR LOOP INLET NODE

~~ 5~~~~~~~~~~~ Air~~~~~~~~~ AIR LOOP OUTLET NODE

Day of Sim, Hour of Day, TimeStep,T1: Temp,T1: MassMinAv,T1: MassMaxAv,T1: TempSP,T1: MassFlow,T1: MassMin,T1: MassMax,T1: MassSP,T1: Press,T1: Enth,T1: HumRat,T1: Fluid Type

1~ 1~ 0.167~ -12.50~~ 0.00~~ 0.00~~ 0.00~~ 0.00~~ 0.00~~ 0.000~~ 0.00~~ 99344.00~~~ -9363.63~~~ 0.0013~ Air
Expand Down
19 changes: 0 additions & 19 deletions doc/output-details-and-examples/src/output-files/eplusout-dbl.tex

This file was deleted.

1 change: 0 additions & 1 deletion src/EnergyPlus/CommandLineInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ state.dataStrGlobals->inputFilePath='{}',
state.files.wrl.filePath = composePath(normalSuffix + ".wrl");
state.dataStrGlobals->outputSqlFilePath = composePath(normalSuffix + ".sql");
state.files.debug.filePath = composePath(normalSuffix + ".dbg");
state.files.dblst.filePath = composePath(normalSuffix + ".dbl");
state.dataStrGlobals->outputPerfLogFilePath = composePath(normalSuffix + "_perflog.csv");
state.dataStrGlobals->outputTblCsvFilePath = composePath(tableSuffix + ".csv");
state.dataStrGlobals->outputTblHtmFilePath = composePath(tableSuffix + ".htm");
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ void EnergyPlusData::clear_state()
this->dataZoneTempPredictorCorrector->clear_state();

this->files.debug.close();
this->files.dblst.close();
this->files.err_stream.reset();
this->files.eso.close();
this->files.mtr.close();
Expand Down
7 changes: 4 additions & 3 deletions src/EnergyPlus/HVACManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,15 @@ void ManageHVAC(EnergyPlusData &state)
}
if ((ReportDebug) && (state.dataGlobal->DayOfSim > 0)) { // Report the node data
if (size(state.dataLoopNodes->Node) > 0 && !state.dataHVACMgr->DebugNamesReported) {
print(state.files.debug, "Day of Sim, Hour of Day, TimeStep,");
print(state.files.dblst, "{}\n", "node # Node Type Name");
print(state.files.debug, "{}\n", "node # Node Type Name");
for (int NodeNum = 1; NodeNum <= isize(state.dataLoopNodes->Node); ++NodeNum) {
print(state.files.dblst, " {:3} {} {}\n",
print(state.files.debug,
" {:3} {} {}\n",
NodeNum,
DataLoopNode::NodeFluidTypeNames[static_cast<int>(state.dataLoopNodes->Node(NodeNum).FluidType)],
state.dataLoopNodes->NodeID(NodeNum));
}
print(state.files.debug, "Day of Sim, Hour of Day, TimeStep,");
for (int NodeNum = 1; NodeNum <= isize(state.dataLoopNodes->Node); ++NodeNum) {
print(state.files.debug, "{}: Temp,", state.dataLoopNodes->NodeID(NodeNum));
print(state.files.debug, "{}: MassMinAv,", state.dataLoopNodes->NodeID(NodeNum));
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/IOFiles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ void IOFiles::flushAll()
rdd.flush();
mdd.flush();
debug.flush();
dblst.flush();
dfs.flush();
mtd.flush();
edd.flush();
Expand Down
19 changes: 9 additions & 10 deletions src/EnergyPlus/IOFiles.hh
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ inline constexpr bool is_fortran_syntax(const std::string_view format_str)

class InputOutputFile;
template <FormatSyntax formatSyntax = FormatSyntax::Fortran, typename... Args>
void print(InputOutputFile &outputFile, std::string_view format_str, Args &&... args);
void print(InputOutputFile &outputFile, std::string_view format_str, Args &&...args);

inline constexpr FormatSyntax check_syntax(const std::string_view format_str)
{
Expand Down Expand Up @@ -610,7 +610,7 @@ public:
private:
std::unique_ptr<std::iostream> os;
bool print_to_dev_null = false;
template <FormatSyntax, typename... Args> friend void print(InputOutputFile &outputFile, std::string_view format_str, Args &&... args);
template <FormatSyntax, typename... Args> friend void print(InputOutputFile &outputFile, std::string_view format_str, Args &&...args);
friend class IOFiles;
};

Expand Down Expand Up @@ -735,7 +735,6 @@ public:
InputOutputFile mdd{"eplusout.mdd"};

InputOutputFile debug{"eplusout.dbg"};
InputOutputFile dblst{"eplusout.dbl"};

InputOutputFile dfs{"eplusout.dfs"};

Expand Down Expand Up @@ -804,7 +803,7 @@ public:
}
};

template <typename... Args> void vprint(std::ostream &os, std::string_view format_str, const Args &... args)
template <typename... Args> void vprint(std::ostream &os, std::string_view format_str, const Args &...args)
{
// assert(os.good());
auto buffer = fmt::memory_buffer();
Expand All @@ -816,7 +815,7 @@ template <typename... Args> void vprint(std::ostream &os, std::string_view forma
os.write(buffer.data(), buffer.size());
}

template <typename... Args> std::string vprint(std::string_view format_str, const Args &... args)
template <typename... Args> std::string vprint(std::string_view format_str, const Args &...args)
{
auto buffer = fmt::memory_buffer();
try {
Expand Down Expand Up @@ -850,19 +849,19 @@ template <typename... Args> std::string vprint(std::string_view format_str, cons
//

namespace {
template <typename... Args> void print_fortran_syntax(std::ostream &os, std::string_view format_str, const Args &... args)
template <typename... Args> void print_fortran_syntax(std::ostream &os, std::string_view format_str, const Args &...args)
{
EnergyPlus::vprint<std::conditional_t<std::is_same_v<double, Args>, DoubleWrapper, Args>...>(os, format_str, args...);
}

template <typename... Args> std::string format_fortran_syntax(std::string_view format_str, const Args &... args)
template <typename... Args> std::string format_fortran_syntax(std::string_view format_str, const Args &...args)
{
return EnergyPlus::vprint<std::conditional_t<std::is_same_v<double, Args>, DoubleWrapper, Args>...>(format_str, args...);
}
} // namespace

template <FormatSyntax formatSyntax = FormatSyntax::Fortran, typename... Args>
void print(std::ostream &os, std::string_view format_str, Args &&... args)
void print(std::ostream &os, std::string_view format_str, Args &&...args)
{
if constexpr (formatSyntax == FormatSyntax::Fortran) {
print_fortran_syntax(os, format_str, args...);
Expand All @@ -873,7 +872,7 @@ void print(std::ostream &os, std::string_view format_str, Args &&... args)
}
}

template <FormatSyntax formatSyntax, typename... Args> void print(InputOutputFile &outputFile, std::string_view format_str, Args &&... args)
template <FormatSyntax formatSyntax, typename... Args> void print(InputOutputFile &outputFile, std::string_view format_str, Args &&...args)
{
auto *outputStream = [&]() -> std::ostream * {
if (outputFile.os) {
Expand All @@ -896,7 +895,7 @@ template <FormatSyntax formatSyntax, typename... Args> void print(InputOutputFil
}
}

template <FormatSyntax formatSyntax = FormatSyntax::Fortran, typename... Args> std::string format(std::string_view format_str, Args &&... args)
template <FormatSyntax formatSyntax = FormatSyntax::Fortran, typename... Args> std::string format(std::string_view format_str, Args &&...args)
{
if constexpr (formatSyntax == FormatSyntax::Fortran) {
return format_fortran_syntax(format_str, args...);
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SimulationManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ namespace SimulationManager {
state.dataResultsFramework->resultsFramework->setupOutputOptions(state);

state.files.debug.ensure_open(state, "OpenOutputFiles", state.files.outputControl.dbg);
state.files.dblst.ensure_open(state, "OpenOutputFiles", state.files.outputControl.dbg);

if (!state.dataSQLiteProcedures->sqlite) {
state.dataSQLiteProcedures->sqlite = EnergyPlus::CreateSQLiteDatabase(state);
Expand Down
5 changes: 0 additions & 5 deletions src/EnergyPlus/UtilityRoutines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,6 @@ void CloseMiscOpenFiles(EnergyPlusData &state)
} else {
state.files.debug.del();
}
if (state.dataReportFlag->DebugOutput || (state.files.dblst.good() && state.files.dblst.position() > 0)) {
state.files.dblst.close();
} else {
state.files.dblst.del();
}
}

int EndEnergyPlus(EnergyPlusData &state)
Expand Down
1 change: 0 additions & 1 deletion tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void EnergyPlusFixture::openOutputFiles(EnergyPlusData &state)
state.files.audit.open_as_stringstream();
state.files.bnd.open_as_stringstream();
state.files.debug.open_as_stringstream();
state.files.dblst.open_as_stringstream();
state.files.mtd.open_as_stringstream();
state.files.edd.open_as_stringstream();
state.files.zsz.open_as_stringstream();
Expand Down

1 comment on commit dd89a15

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reformat-eplusout-dbg-file (rraustad) - x86_64-MacOS-10.18-clang-15.0.0: OK (3553 of 3554 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.