Skip to content

Commit

Permalink
Curves used, input warnings, ResultsFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Aug 19, 2024
1 parent 5774851 commit 85a2ef2
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 62 deletions.
28 changes: 26 additions & 2 deletions src/EnergyPlus/CurveManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
#include <EnergyPlus/EMSManager.hh>
#include <EnergyPlus/FileSystem.hh>
#include <EnergyPlus/GlobalNames.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/UtilityRoutines.hh>

Expand Down Expand Up @@ -676,6 +675,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;

Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);
Expand Down Expand Up @@ -759,6 +759,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -825,6 +826,7 @@ namespace Curve {
_,
state.dataIPShortCut->cAlphaFieldNames,
state.dataIPShortCut->cNumericFieldNames);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
GlobalNames::VerifyUniqueInterObjectName(state,
state.dataCurveManager->UniqueCurveNames,
Expand Down Expand Up @@ -895,6 +897,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -959,6 +962,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1023,6 +1027,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1104,6 +1109,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1185,6 +1191,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1249,6 +1256,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1330,6 +1338,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1452,6 +1461,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1531,6 +1541,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1611,6 +1622,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1664,6 +1676,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1732,6 +1745,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1798,6 +1812,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1864,6 +1879,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1930,6 +1946,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -1996,6 +2013,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -2062,6 +2080,7 @@ namespace Curve {
CurrentModuleObject,
state.dataIPShortCut->cAlphaFieldNames(1),
ErrorsFound);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
Curve *thisCurve = state.dataCurveManager->PerfCurve(CurveNum);

Expand Down Expand Up @@ -2122,6 +2141,7 @@ namespace Curve {
state.dataIPShortCut->cAlphaFieldNames,
state.dataIPShortCut->cNumericFieldNames);

state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
std::string wpcName = Alphas(1); // Name of CP array
int numWindDir = NumNumbers;
std::vector<Real64> windDirs(numWindDir);
Expand Down Expand Up @@ -2172,6 +2192,7 @@ namespace Curve {
_,
state.dataIPShortCut->cAlphaFieldNames,
state.dataIPShortCut->cNumericFieldNames);
state.dataInputProcessing->inputProcessor->unusedInputs.emplace(CurrentModuleObject, Alphas(1));
++CurveNum;
GlobalNames::VerifyUniqueInterObjectName(state,
state.dataCurveManager->UniqueCurveNames,
Expand Down Expand Up @@ -3072,7 +3093,10 @@ namespace Curve {

if (state.dataCurveManager->NumCurves > 0) {
for (int Count = 1; Count <= (int)state.dataCurveManager->PerfCurve.size(); ++Count) {
if (CurveName == state.dataCurveManager->PerfCurve(Count)->Name) return Count;
if (CurveName == state.dataCurveManager->PerfCurve(Count)->Name) {
state.dataCurveManager->PerfCurve(Count)->markUsed(state);
return Count;
}
}
return 0; // Not found
} else {
Expand Down
15 changes: 14 additions & 1 deletion src/EnergyPlus/CurveManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/EnergyPlusLogger.hh>
#include <EnergyPlus/FileSystem.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/UtilityRoutines.hh>

namespace EnergyPlus {
Expand Down Expand Up @@ -151,7 +152,8 @@ namespace Curve {
struct Curve
{
// Basic data
std::string Name; // Curve Name
std::string Name; // Curve Name
bool used = true;
CurveType curveType = CurveType::Invalid; // Curve type (see parameter definitions above)
// Table data stuff
InterpType interpolationType = InterpType::Invalid; // Table interpolation method
Expand Down Expand Up @@ -208,6 +210,17 @@ namespace Curve {
const Real64 Var4, // 4th independent variable
const Real64 Var5, // 5th independent variable
const Real64 Var6);

void markUsed(EnergyPlusData &state)
{
if (!this->used) return;
auto const find_unused =
state.dataInputProcessing->inputProcessor->unusedInputs.find({std::string(objectNames[int(this->curveType)]), this->Name});
if (find_unused != state.dataInputProcessing->inputProcessor->unusedInputs.end()) {
state.dataInputProcessing->inputProcessor->unusedInputs.erase(find_unused);
}
this->used = false;
};
};

// Table file objects
Expand Down
44 changes: 21 additions & 23 deletions src/EnergyPlus/DataErrorTracking.hh
Original file line number Diff line number Diff line change
Expand Up @@ -206,29 +206,27 @@ struct ErrorTrackingData : BaseGlobalStruct
{
Array1D<DataErrorTracking::RecurringErrorData> RecurringErrors;
Array1D_int MatchCounts;
bool AbortProcessing = false; // Flag used to if currently in "abort processing"
int NumRecurringErrors = 0; // Number of stored recurring error messages
int TotalSevereErrors = 0; // Counter
int TotalWarningErrors = 0; // Counter
int TotalSevereErrorsDuringInputsSizing = 0; // Counter
int TotalWarningErrorsDuringInputsSizing = 0; // Counter
int TotalSevereErrorsDuringInputsWarmup = 0; // Counter
int TotalWarningErrorsDuringInputsWarmup = 0; // Counter
int TotalSevereErrorsDuringWarmup = 0; // Counter
int TotalWarningErrorsDuringWarmup = 0; // Counter
int TotalSevereErrorsDuringSizing = 0; // Counter
int TotalWarningErrorsDuringSizing = 0; // Counter
int TotalMultipliedWindows = 0; // Counter
int TotalCoincidentVertices = 0; // Counter
int TotalDegenerateSurfaces = 0; // Counter
int TotalReceivingNonConvexSurfaces = 0; // Counter
int TotalCastingNonConvexSurfaces = 0; // Counter
int TotalRoomAirPatternTooLow = 0; // Counter
int TotalRoomAirPatternTooHigh = 0; // Counter
bool AskForConnectionsReport = false; // Flag used to tell when connections should be reported
bool AskForSurfacesReport = false; // Flag used to tell when surfaces should be reported
bool AskForPlantCheckOnAbort = false; // flag used to tell if plant structure can be checked
bool ExitDuringSimulations = false; // flag used to tell if program is in simulation mode when fatal occurs
bool AbortProcessing = false; // Flag used to if currently in "abort processing"
int NumRecurringErrors = 0; // Number of stored recurring error messages
int TotalSevereErrors = 0; // Counter
int TotalWarningErrors = 0; // Counter
int TotalSevereErrorsDuringInputs = 0; // Counter
int TotalWarningErrorsDuringInputs = 0; // Counter
int TotalSevereErrorsDuringWarmup = 0; // Counter
int TotalWarningErrorsDuringWarmup = 0; // Counter
int TotalSevereErrorsDuringSizing = 0; // Counter
int TotalWarningErrorsDuringSizing = 0; // Counter
int TotalMultipliedWindows = 0; // Counter
int TotalCoincidentVertices = 0; // Counter
int TotalDegenerateSurfaces = 0; // Counter
int TotalReceivingNonConvexSurfaces = 0; // Counter
int TotalCastingNonConvexSurfaces = 0; // Counter
int TotalRoomAirPatternTooLow = 0; // Counter
int TotalRoomAirPatternTooHigh = 0; // Counter
bool AskForConnectionsReport = false; // Flag used to tell when connections should be reported
bool AskForSurfacesReport = false; // Flag used to tell when surfaces should be reported
bool AskForPlantCheckOnAbort = false; // flag used to tell if plant structure can be checked
bool ExitDuringSimulations = false; // flag used to tell if program is in simulation mode when fatal occurs
std::string LastSevereError;

ErrorTrackingData()
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/InputProcessing/InputProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ bool InputProcessor::checkVersionMatch(EnergyPlusData &state)
Which = static_cast<int>(index(v, MatchVersion));
}
if (Which != 0) {
ShowWarningError(state, "Version: in IDF=\"" + v + "\" not the same as expected=\"" + MatchVersion + "\"");
// this is reported in GetProjectData
// ShowWarningError(state, "Version: in IDF=\"" + v + "\" not the same as expected=\"" + MatchVersion + "\"");
return false;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/InputProcessing/InputProcessor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@ private:
UnorderedObjectCacheMap objectCacheMap;

// ObjectType to vector of ObjectName
UnusedObjectSet unusedInputs;
char s[129] = {0};

public:
UnusedObjectSet unusedInputs;

}; // InputProcessor

struct DataInputProcessing : BaseGlobalStruct
Expand Down
7 changes: 7 additions & 0 deletions src/EnergyPlus/ResultsFramework.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ namespace ResultsFramework {
RunTime = elapsedTime;
}

void SimInfo::setNumErrorsInputs(const std::string &numWarningsDuringInputs, const std::string &numSevereDuringInputs)
{
NumWarningsDuringInputs = numWarningsDuringInputs;
NumSevereDuringInputs = numSevereDuringInputs;
}

void SimInfo::setNumErrorsWarmup(const std::string &numWarningsDuringWarmup, const std::string &numSevereDuringWarmup)
{
NumWarningsDuringWarmup = numWarningsDuringWarmup;
Expand All @@ -149,6 +155,7 @@ namespace ResultsFramework {
{"StartDateTimeStamp", StartDateTimeStamp},
{"RunTime", RunTime},
{"ErrorSummary", {{"NumWarnings", NumWarnings}, {"NumSevere", NumSevere}}},
{"ErrorSummaryInputs", {{"NumWarnings", NumWarningsDuringInputs}, {"NumSevere", NumSevereDuringInputs}}},
{"ErrorSummaryWarmup", {{"NumWarnings", NumWarningsDuringWarmup}, {"NumSevere", NumSevereDuringWarmup}}},
{"ErrorSummarySizing", {{"NumWarnings", NumWarningsDuringSizing}, {"NumSevere", NumSevereDuringSizing}}}};
return root;
Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/ResultsFramework.hh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ namespace ResultsFramework {
void setInputModelURI(const std::string &inputModelURI);
void setStartDateTimeStamp(const std::string &startDateTimeStamp);
void setRunTime(const std::string &elapsedTime);
void setNumErrorsInputs(const std::string &numWarningsDuringInputs, const std::string &numSevereDuringInputs);
void setNumErrorsWarmup(const std::string &numWarningsDuringWarmup, const std::string &numSevereDuringWarmup);
void setNumErrorsSizing(const std::string &numWarningsDuringSizing, const std::string &numSevereDuringSizing);
void setNumErrorsSummary(const std::string &numWarnings, const std::string &numSevere);
Expand All @@ -108,7 +109,8 @@ namespace ResultsFramework {
std::string InputModelURI;
std::string StartDateTimeStamp;
std::string RunTime;
std::string NumWarningsDuringWarmup, NumSevereDuringWarmup, NumWarningsDuringSizing, NumSevereDuringSizing, NumWarnings, NumSevere;
std::string NumWarningsDuringInputs, NumSevereDuringInputs, NumWarningsDuringWarmup, NumSevereDuringWarmup, NumWarningsDuringSizing,
NumSevereDuringSizing, NumWarnings, NumSevere;
};

class Variable : public BaseResultObject
Expand Down
Loading

5 comments on commit 85a2ef2

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

Round2_init_state_use (rraustad) - Win64-Windows-10-VisualStudio-16: OK (2866 of 2869 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1580
  • Failed: 1

ResultsFrameworkFixture Test Summary

  • Passed: 12
  • Failed: 2

Build Badge Test Badge

@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.

Round2_init_state_use (rraustad) - x86_64-MacOS-10.18-clang-15.0.0: OK (3567 of 3662 tests passed, 728 test warnings)

Messages:\n

  • 728 tests had: ERR diffs.
  • 29 tests had: EDD diffs.
  • 19 tests had: EIO diffs.
  • 1 test had: AUD diffs.
  • 1 test had: RDD diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1554
  • SEGFAULT: 29

integration Test Summary

  • Passed: 731
  • Failed: 64

ResultsFrameworkFixture Test Summary

  • Passed: 12
  • Failed: 2

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

Round2_init_state_use (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3700 of 3703 tests passed, 796 test warnings)

Messages:\n

  • 796 tests had: ERR diffs.
  • 36 tests had: EDD diffs.
  • 19 tests had: EIO diffs.
  • 1 test had: AUD diffs.
  • 1 test had: RDD diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1582
  • SEGFAULT: 1

ResultsFrameworkFixture Test Summary

  • Passed: 12
  • Failed: 2

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Round2_init_state_use (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2044 of 2076 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1554
  • Subprocess aborted: 29

ResultsFrameworkFixture Test Summary

  • Passed: 12
  • Failed: 2

ZoneUnitarySysTest Test Summary

  • Passed: 26
  • NUMERICAL: 1

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

Round2_init_state_use (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: Coverage Too Low

Failures:\n

integration Test Summary

  • Passed: 732
  • Failed: 64

Build Badge Test Badge Coverage Badge

Please sign in to comment.