Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into convert_misc_forma…
Browse files Browse the repository at this point in the history
…ts_from_gio
  • Loading branch information
lefticus committed May 7, 2020
2 parents 69a8940 + a946ef1 commit 8b5e5da
Show file tree
Hide file tree
Showing 34 changed files with 67,648 additions and 359 deletions.
2 changes: 1 addition & 1 deletion .decent_ci-Linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ compilers:
- "TGZ"
- "IFW"
release_build_cmake_extra_flags: -DENABLE_REGRESSION_TESTING:BOOL=ON -DBUILD_DOCS:BOOL=ON
cmake_extra_flags: -DLINK_WITH_PYTHON=ON -DBUILD_DOCS:BOOL=ON -DTEX_INTERACTION="nonstopmode" -DBUILD_FORTRAN=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DBUILD_PERFORMANCE_TESTS:BOOL=ON -DVALGRIND_ANALYZE_PERFORMANCE_TESTS:BOOL=ON
cmake_extra_flags: -DLINK_WITH_PYTHON=ON -DBUILD_DOCS:BOOL=ON -DTEX_INTERACTION="nonstopmode" -DBUILD_FORTRAN=ON -DBUILD_OLD_TRANSITIONS:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DBUILD_PERFORMANCE_TESTS:BOOL=ON -DVALGRIND_ANALYZE_PERFORMANCE_TESTS:BOOL=ON
collect_performance_results: true
s3_upload: doc/pdf
s3_upload_bucket: energyplus
Expand Down
2 changes: 1 addition & 1 deletion .decent_ci-MacOS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ compilers:
- IFW
- TGZ
release_build_cmake_extra_flags: -DBUILD_DOCS:BOOL=ON
cmake_extra_flags: -DBUILD_FORTRAN=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON
cmake_extra_flags: -DBUILD_FORTRAN=ON -DBUILD_OLD_TRANSITIONS:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON

4 changes: 2 additions & 2 deletions .decent_ci-Windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ compilers:
build_package_generator:
- IFW
release_build_cmake_extra_flags: -DBUILD_DOCS:BOOL=ON -DTEX_INTERACTION="nonstopmode"
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_OLD_TRANSITIONS:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF

- name: Visual Studio
version: 16
Expand All @@ -15,5 +15,5 @@ compilers:
- IFW
- ZIP
release_build_cmake_extra_flags: -DBUILD_DOCS:BOOL=ON -DTEX_INTERACTION="nonstopmode"
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_OLD_TRANSITIONS:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON

6 changes: 4 additions & 2 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ ELSEIF ( CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
ADD_CXX_DEFINITIONS("-pedantic") # Turn on warnings about constructs/situations that may be non-portable or outside of the standard
ADD_CXX_DEFINITIONS("-Wall -Wextra") # Turn on warnings
ADD_CXX_DEFINITIONS("-Wno-unknown-pragmas")
ADD_CXX_DEFINITIONS("-Wno-deprecated-copy")
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
ADD_CXX_DEFINITIONS("-Wno-deprecated-copy")
endif()
ADD_CXX_DEFINITIONS("-Wno-attributes") # Don't warn on attributes Clang doesn't know
ADD_CXX_DEFINITIONS("-Wno-delete-non-virtual-dtor")
ADD_CXX_DEFINITIONS("-Wno-missing-braces")
Expand Down Expand Up @@ -264,4 +266,4 @@ if(CMAKE_GENERATOR MATCHES "Make")
set(MAKE "$(MAKE)")
else()
set(MAKE make)
endif()
endif()
5 changes: 4 additions & 1 deletion src/EnergyPlus/EMSManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,10 @@ namespace EMSManager {
anyProgramRan = false;
if (!AnyEnergyManagementSystemInModel) return; // quick return if nothing to do

if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironment) BeginEnvrnInitializeRuntimeLanguage();
if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironment) {
BeginEnvrnInitializeRuntimeLanguage();
PluginManagement::onBeginEnvironment();
}

InitEMS(iCalledFrom);

Expand Down
24 changes: 19 additions & 5 deletions src/EnergyPlus/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,17 @@ namespace PluginManagement {
callbacks[iCalledFrom].push_back(f);
}

void onBeginEnvironment() {
// reset vars and trends -- sensors and actuators are reset by EMS
for (auto & v : globalVariableValues) {
v = 0;
}
// reinitialize trend variables so old data are purged
for (auto & tr : trends) {
tr.reset();
}
}

int PluginManager::numActiveCallbacks()
{
return (int)callbacks.size();
Expand All @@ -422,8 +433,8 @@ namespace PluginManagement {
#if LINK_WITH_PYTHON == 1
for (auto &plugin : plugins) {
if (plugin.runDuringWarmup || !DataGlobals::WarmupFlag) {
plugin.run(iCalledFrom);
anyRan = true;
bool const didOneRun = plugin.run(iCalledFrom);
if (didOneRun) anyRan = true;
}
}
#endif
Expand Down Expand Up @@ -1191,8 +1202,9 @@ namespace PluginManagement {
}

#if LINK_WITH_PYTHON == 1
void PluginInstance::run(int iCalledFrom) const
bool PluginInstance::run(int iCalledFrom) const
{
// returns true if a plugin actually ran
const char *functionName = nullptr;
if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironment) {
if (this->bHasBeginNewEnvironment) {
Expand Down Expand Up @@ -1266,7 +1278,7 @@ namespace PluginManagement {

// leave if we didn't find a match
if (!functionName) {
return;
return false;
}

// then call the main function
Expand Down Expand Up @@ -1297,10 +1309,12 @@ namespace PluginManagement {
if (EnergyPlus::PluginManagement::apiErrorFlag) {
EnergyPlus::ShowFatalError("API problems encountered while running plugin cause program termination.");
}
return true;
}
#else
void PluginInstance::run(int EP_UNUSED(iCalledFrom)) const
bool PluginInstance::run(int EP_UNUSED(iCalledFrom)) const
{
return false;
}
#endif

Expand Down
9 changes: 8 additions & 1 deletion src/EnergyPlus/PluginManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ namespace PluginManagement {

void registerNewCallback(int iCalledFrom, const std::function<void ()>& f);
void runAnyRegisteredCallbacks(int iCalledFrom, bool &anyRan);
void onBeginEnvironment();
std::string pythonStringForUsage();

void clear_state();
Expand Down Expand Up @@ -96,7 +97,7 @@ namespace PluginManagement {

// methods
static void reportPythonError();
void run(int iCallingPoint) const; // calls main() on this plugin instance
bool run(int iCallingPoint) const; // calls main() on this plugin instance

// plugin calling point hooks
const char * sHookBeginNewEnvironment = "on_begin_new_environment";
Expand Down Expand Up @@ -185,6 +186,12 @@ namespace PluginManagement {
this->times.push_back(-loop * DataGlobals::TimeStepZone);
}
}
void reset() {
this->values.clear();
for (int i = 1; i <= this->numValues; i++) {
this->values.push_back(0);
}
}
};

extern std::unique_ptr<PluginManager> pluginManager;
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/RuntimeLanguageProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3057,7 +3057,7 @@ namespace RuntimeLanguageProcessor {
}
} else if (UnitsB == "" && UnitsA != "") {
UnitsB = UnitsA;
ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " using deprecated units designation.");
ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" using deprecated units designation.");
ShowContinueError("...Units entered in " + cAlphaFieldNames(1) + " (deprecated use)=\"" + UnitsA + "\"");
}
}
Expand Down Expand Up @@ -3225,7 +3225,7 @@ namespace RuntimeLanguageProcessor {
}
} else if (UnitsB == "" && UnitsA != "") {
UnitsB = UnitsA;
ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + " using deprecated units designation.");
ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\" using deprecated units designation.");
ShowContinueError("...Units entered in " + cAlphaFieldNames(1) + " (deprecated use)=\"" + UnitsA + "\"");
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/Transition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ set(LIB_SRC
)
add_library( TransitionLib STATIC ${LIB_SRC} )

set(BUILD_OLD_TRANSITIONS OFF CACHE BOOL "Only turn this on if you really want to build all the old transition tools")

if (BUILD_OLD_TRANSITIONS)
list( APPEND VERSIONS 1_0_0 )
list( APPEND VERSIONS 1_0_1 )
list( APPEND VERSIONS 1_0_2 )
Expand Down Expand Up @@ -55,6 +58,7 @@ list( APPEND VERSIONS 8_4_0 )
list( APPEND VERSIONS 8_5_0 )
list( APPEND VERSIONS 8_6_0 )
list( APPEND VERSIONS 8_7_0 )
endif()
list( APPEND VERSIONS 8_8_0 )
list( APPEND VERSIONS 8_9_0 )
list( APPEND VERSIONS 9_0_0 )
Expand Down Expand Up @@ -177,3 +181,4 @@ install(FILES "SupportFiles/Report Variables 8-9-0 to 9-0-0.csv" DESTINATION "Pr
install(FILES "SupportFiles/Report Variables 9-0-0 to 9-1-0.csv" DESTINATION "PreProcess/IDFVersionUpdater/")
install(FILES "SupportFiles/Report Variables 9-1-0 to 9-2-0.csv" DESTINATION "PreProcess/IDFVersionUpdater/")
install(FILES "SupportFiles/Report Variables 9-2-0 to 9-3-0.csv" DESTINATION "PreProcess/IDFVersionUpdater/")

15 changes: 12 additions & 3 deletions testfiles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,23 @@ ADD_SIMULATION_TEST(IDF_FILE PurchAirWithDaylightingAndShadeControl.idf EPW_FILE
ADD_SIMULATION_TEST(IDF_FILE PurchAirWithDaylightingAngleFac.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PurchAirWithDoubleFacadeDaylighting.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
if (LINK_WITH_PYTHON)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginAirflowNetworkOpeningControlByHumidity.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginConstantVolumePurchasedAir.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginCurveOverride_PackagedTerminalHeatPump.idf EPW_FILE USA_FL_Miami.Intl.AP.722020_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginCustomOutputVariable.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginCustomTrendVariable.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginCustomSchedule.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginLrgOff_GridStorageSmoothing.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginWindowShadeControl.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginDemandManager_LargeOffice.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginDiscreteAirSystemSizes.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginPlantLoopOverrideControl.idf EPW_FILE USA_FL_Orlando.Intl.AP.722050_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginPlantOperation_largeOff.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginReplaceTraditionalManagers_LargeOffice.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginTestMathAndKill.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw EXPECT_FATAL) # Expected to Fatal
ADD_SIMULATION_TEST(IDF_FILE PythonPluginThermochromicWindow.idf EPW_FILE USA_NV_Las.Vegas-McCarran.Intl.AP.723860_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginUserDefined5ZoneAirCooled.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginUserDefinedWindACAuto.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginWindowShadeControl.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginLrgOff_GridStorageSmoothing.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE PythonPluginCustomTrendVariable.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
endif()
ADD_SIMULATION_TEST(IDF_FILE QTFtest.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
ADD_SIMULATION_TEST(IDF_FILE RadHiTempElecTermReheat.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
Expand Down
Loading

6 comments on commit 8b5e5da

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

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

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

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (12 of 12 tests passed, 0 test warnings)

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

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2819 of 2836 tests passed, 0 test warnings)

Messages:\n

  • 17 tests had: Table big diffs.
  • 1 test had: EIO diffs.

Failures:\n

regression Test Summary

  • Passed: 706
  • Failed: 17

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.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1388 of 1388 tests passed, 0 test warnings)

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.

convert_misc_formats_from_gio (lefticus) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (707 of 708 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 707
  • Timeout: 1

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

convert_misc_formats_from_gio (lefticus) - Win64-Windows-10-VisualStudio-16: OK (2755 of 2772 tests passed, 0 test warnings)

Messages:\n

  • 17 tests had: Table big diffs.
  • 1 test had: EIO diffs.

Failures:\n

regression Test Summary

  • Passed: 686
  • Failed: 17

Build Badge Test Badge

Please # to comment.