-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Alternate Configurations Build #8696
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,8 @@ | |
|
||
namespace EnergyPlus { | ||
|
||
constexpr int NumPsychMonitors = 19; // Parameterization of Number of psychrometric routines that | ||
|
||
#ifdef EP_nocache_Psychrometrics | ||
#undef EP_cache_PsyTwbFnTdbWPb | ||
#undef EP_cache_PsyPsatFnTemp | ||
|
@@ -136,6 +138,11 @@ struct PsychrometricCacheData : BaseGlobalStruct | |
Array1D<cached_tsat_h_pb> cached_Tsat_HPb; // DIMENSION(0:tsat_hbp_cache_size) | ||
#endif | ||
|
||
#ifdef EP_psych_stats | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving these over to PsychCacheData to avoid circular references |
||
Array1D<Int64> NumTimesCalled = Array1D<Int64>(NumPsychMonitors, 0); | ||
Array1D_int NumIterations = Array1D_int(NumPsychMonitors, 0); | ||
#endif | ||
|
||
void clear_state() override | ||
{ | ||
#ifdef EP_cache_PsyTwbFnTdbWPb | ||
|
@@ -149,6 +156,10 @@ struct PsychrometricCacheData : BaseGlobalStruct | |
#endif | ||
#ifdef EP_cache_PsyTsatFnHPb | ||
cached_Tsat_HPb.clear(); | ||
#endif | ||
#ifdef EP_psych_stats | ||
NumTimesCalled = Array1D<Int64>(NumPsychMonitors, 0); | ||
NumIterations = Array1D_int(NumPsychMonitors, 0); | ||
#endif | ||
} | ||
}; | ||
|
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 |
---|---|---|
|
@@ -184,11 +184,7 @@ namespace Psychrometrics { | |
#endif | ||
} | ||
|
||
#ifdef EP_psych_stats | ||
void ShowPsychrometricSummary(InputOutputFile &auditFile) | ||
#else | ||
void ShowPsychrometricSummary([[maybe_unused]] InputOutputFile &auditFile) | ||
#endif | ||
void ShowPsychrometricSummary([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] InputOutputFile &auditFile) | ||
{ | ||
|
||
// SUBROUTINE INFORMATION: | ||
|
@@ -227,14 +223,14 @@ namespace Psychrometrics { | |
Real64 AverageIterations; | ||
|
||
if (!auditFile.good()) return; | ||
if (any_gt(state.dataPsychrometrics->NumTimesCalled, 0)) { | ||
if (any_gt(state.dataPsychCache->NumTimesCalled, 0)) { | ||
print(auditFile, "RoutineName,#times Called,Avg Iterations\n"); | ||
for (Loop = 1; Loop <= NumPsychMonitors; ++Loop) { | ||
if (!PsyReportIt(Loop)) continue; | ||
const auto istring = fmt::to_string(state.dataPsychrometrics->NumTimesCalled(Loop)); | ||
if (state.dataPsychrometrics->NumIterations(Loop) > 0) { | ||
const auto istring = fmt::to_string(state.dataPsychCache->NumTimesCalled(Loop)); | ||
if (state.dataPsychCache->NumIterations(Loop) > 0) { | ||
AverageIterations = | ||
double(state.dataPsychrometrics->NumIterations(Loop)) / double(state.dataPsychrometrics->NumTimesCalled(Loop)); | ||
double(state.dataPsychCache->NumIterations(Loop)) / double(state.dataPsychCache->NumTimesCalled(Loop)); | ||
print(auditFile, "{},{},{:.2R}\n", PsyRoutineNames(Loop), istring, AverageIterations); | ||
} else { | ||
print(auditFile, "{},{}\n", PsyRoutineNames(Loop), istring); | ||
|
@@ -471,7 +467,7 @@ namespace Psychrometrics { | |
bool FlagError; // set when errors should be flagged | ||
|
||
#ifdef EP_psych_stats | ||
++state.dataPsychrometrics->NumTimesCalled(iPsyTwbFnTdbWPb); | ||
++state.dataPsychCache->NumTimesCalled(iPsyTwbFnTdbWPb); | ||
#endif | ||
|
||
// CHECK TDB IN RANGE. | ||
|
@@ -583,7 +579,7 @@ namespace Psychrometrics { | |
} // End of Iteration Loop | ||
|
||
#ifdef EP_psych_stats | ||
state.dataPsychrometrics->NumIterations(iPsyTwbFnTdbWPb) += iter; | ||
state.dataPsychCache->NumIterations(iPsyTwbFnTdbWPb) += iter; | ||
#endif | ||
|
||
// Wet bulb temperature has not converged after maximum specified | ||
|
@@ -712,7 +708,7 @@ namespace Psychrometrics { | |
|
||
Real64 PsyPsatFnTemp(EnergyPlusData &state, | ||
Real64 const T, // dry-bulb temperature {C} | ||
std::string const &CalledFrom // routine this function was called from (error messages) | ||
[[maybe_unused]] std::string const &CalledFrom // routine this function was called from (error messages) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silence warning |
||
) | ||
#endif | ||
{ | ||
|
@@ -752,7 +748,7 @@ namespace Psychrometrics { | |
// FUNCTION LOCAL VARIABLE DECLARATIONS: | ||
|
||
#ifdef EP_psych_stats | ||
++state.dataPsychrometrics->NumTimesCalled(iPsyPsatFnTemp); | ||
++state.dataPsychCache->NumTimesCalled(iPsyPsatFnTemp); | ||
#endif | ||
|
||
// CHECK T IN RANGE. | ||
|
@@ -1000,7 +996,7 @@ namespace Psychrometrics { | |
} | ||
|
||
#ifdef EP_psych_stats | ||
++state.dataPsychrometrics->NumTimesCalled(iPsyTsatFnHPb); | ||
++state.dataPsychCache->NumTimesCalled(iPsyTsatFnHPb); | ||
#endif | ||
|
||
FlagError = false; | ||
|
@@ -1352,7 +1348,7 @@ namespace Psychrometrics { | |
int iter; // Iteration counter | ||
|
||
#ifdef EP_psych_stats | ||
++state.dataPsychrometrics->NumTimesCalled(iPsyTsatFnPb); | ||
++state.dataPsychCache->NumTimesCalled(iPsyTsatFnPb); | ||
#endif | ||
|
||
// Check press in range. | ||
|
@@ -1433,7 +1429,7 @@ namespace Psychrometrics { | |
} // End If for the Pressure Range Checking | ||
|
||
#ifdef EP_psych_stats | ||
state.dataPsychrometrics->NumIterations(iPsyTsatFnPb) += iter; | ||
state.dataPsychCache->NumIterations(iPsyTsatFnPb) += iter; | ||
#endif | ||
|
||
#ifdef EP_psych_errors | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how this worked before, but this should be the right way to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitchute without these two USE_PSYCH* lines, is it still exercising the code that depends on those two variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JasonGlazer no, those variables are not used without those CMake flags.