Skip to content

Native E+ CSV output and conditional output file selection#7904

Merged
Myoldmopar merged 48 commits intodevelopfrom
improve_file_io_with_fmt_refactor
Aug 21, 2020
Merged

Native E+ CSV output and conditional output file selection#7904
Myoldmopar merged 48 commits intodevelopfrom
improve_file_io_with_fmt_refactor

Conversation

@mbadams5
Copy link
Contributor

@mbadams5 mbadams5 commented Apr 7, 2020

Pull request overview

This pull request implements a native E+ CSV output capability as well as add a new object to conditionally turn on/off output files.
Fixes #6552

Overall E+ runtime

OutPatient Model (seconds) original/yes all/yes original/no all/no
9.3 runtime 353.76 2941.5
branch runtime 267.6 1662 308.4 964.8
% reduction 24.4% 43.5% -15.2% 41.9%
speed up 1.32x 1.77x 0.87x 1.72x

Native E+ vs ReadVarsESO

OutPatient Model (seconds) original/yes all/yes
ReadVarsESO 0.156 1782.81
Native E+ CSV .518 555.6
% reduction -232.1% 68.8%
speed up 0.3x 3.21x
MediumOffice Model (seconds) all/yes
ReadVarsESO 183
Native E+ CSV 34.12
% reduction 81.4%
speed up 5.36x
  • original: OutPatient model as in testfiles
  • all: OutPatient model with ALL Output:Variables/Output:Meters from RDD/MDD file
  • yes: Outputs all normal output files during simulation
  • no: Outputs no output files during simulation using new Output:Control object

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@mbadams5 mbadams5 added the Performance Includes code changes that are directed at improving the runtime performance of EnergyPlus label Apr 7, 2020
@mbadams5
Copy link
Contributor Author

mbadams5 commented Apr 7, 2020

The Mac and Linux CI issues are related to #7907 and not this PR.

@mbadams5 mbadams5 added this to the EnergyPlus 9.4.0 milestone Apr 7, 2020
@mbadams5 mbadams5 requested review from Myoldmopar and mjwitte April 7, 2020 19:28
@mbadams5 mbadams5 marked this pull request as ready for review April 7, 2020 19:35
@Myoldmopar Myoldmopar added this to the EnergyPlus 9.4.0 IOFreeze milestone Aug 14, 2020
# Conflicts:
#	src/EnergyPlus/CommandLineInterface.cc
#	src/EnergyPlus/DElightManagerF.cc
#	src/EnergyPlus/DataStringGlobals.hh
#	src/EnergyPlus/DataSystemVariables.cc
#	src/EnergyPlus/DaylightingManager.cc
#	src/EnergyPlus/EMSManager.cc
#	src/EnergyPlus/HeatBalanceManager.cc
#	src/EnergyPlus/HeatBalanceSurfaceManager.cc
#	src/EnergyPlus/IOFiles.cc
#	src/EnergyPlus/OutputFiles.hh
#	src/EnergyPlus/OutputProcessor.cc
#	src/EnergyPlus/OutputReportTabular.cc
#	src/EnergyPlus/OutputReports.cc
#	src/EnergyPlus/ResultsFramework.cc
#	src/EnergyPlus/ResultsFramework.hh
#	src/EnergyPlus/ScheduleManager.cc
#	src/EnergyPlus/SimulationManager.cc
#	src/EnergyPlus/SizingManager.cc
#	src/EnergyPlus/StateManagement.cc
#	src/EnergyPlus/UtilityRoutines.cc
#	src/EnergyPlus/WindowManager.cc
#	src/EnergyPlus/api/EnergyPlusPgm.cc
#	tst/EnergyPlus/unit/OutputReportTabular.unit.cc
@Myoldmopar
Copy link
Member

Minor build warning popped up on Mac, but otherwise this last commit is looking fantastic. I have not looked at the changes yet, though. If we got the build warning fixed up, does this address the discussion during the call yesterday or are there still more changes to make?

@Myoldmopar
Copy link
Member

Outside of the ERR diffs, this looks good. I'm assuming we don't actually want those warnings popping up in there, right?

I think I'm going to make an "IO-Freeze-Release-Candidate" just to make sure packages are doing OK since it has been a while since we made them on CI. I will plan on closing the IO freeze door by tomorrow morning, so if you can get the ERR diffs cleaned up, that would be great. If not, we can discuss dropping this in with those temporarily in there. Assuming it's otherwise ready to go.

Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

This is an incredibly awesome new feature. I am hopeful that the CI results continue to look promising and we can get this merged in right away. I think at this point, even if there are a few rough edges, I'm still inclined to get it in and clean up anything remaining with a follow-up issue.



OutputControl:Files,
\memo Conditionally turn on/off output from EnergyPlus.
Copy link
Member

Choose a reason for hiding this comment

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

Tab character got left in here.

ResultsSchema.cc
ResultsSchema.hh
ResultsFramework.cc
ResultsFramework.hh
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Myoldmopar
Copy link
Member

Gah, tons of diffs due to develop moving.

@Myoldmopar
Copy link
Member

I don't know where that unit test failure on Mac came from, but I don't think it's the changes made here. This looks great. @mbadams5 are you satisfied with where it is at? If so I'll pull it and test it out a bit.

@mbadams5
Copy link
Contributor Author

@Myoldmopar, yes I think this is ready to go. Please feel free to review it and test it out.

@Myoldmopar
Copy link
Member

OK, so I built and tested this locally. Some issues, but I think I'm going to merge it in for now to get the I/O side done for freeze.

  • I took an example file and tried to run it with the new object and got a seg fault. It turns out I entered "output:control:files" instead of "outputcontrol:files". Seg fault because of a bad object name?
  • I changed the object name and it built fine, but the output files were not responding to my inputs. I found that the get input routine was using the wrong name as well. In the IDD it is "OutputControl:Files", but in the code it was just "Output:Files". So it was not actually reading in my new object
  • I built with the new name and it was back to a seg fault. I found that in the input processing function, it was looking for keys in the json input processor with the names "json" and "tabular", instead of "output_json" and "output_tabular". Seg fault from bad key lookup.
  • I then fixed the names it was looking up and it ran, and appeared to generally respond well. Several of the files were omitted which is great, but the meter file seemed to be produced even if I asked it to not be produced.

Obviously there is still some work to do here, but the I/O is settled, and as long as you don't use the new object, EnergyPlus runs fine. I'm going to merge and we can open up a follow-up ticket to address these post-freeze.

Thanks @mbadams5, once polished this is going to be a really great addition!

@Myoldmopar Myoldmopar merged commit 908c5ce into develop Aug 21, 2020
@Myoldmopar Myoldmopar deleted the improve_file_io_with_fmt_refactor branch August 21, 2020 17:32
@mitchute mitchute mentioned this pull request Aug 24, 2020
3 tasks
@Myoldmopar Myoldmopar mentioned this pull request Sep 2, 2020
20 tasks
Comment on lines +8822 to +8826
print(state.files.rdd, "Program Version,{},{}{}", VerString, IDDVerString, DataStringGlobals::NL);
print(state.files.rdd, "Var Type (reported time step),Var Report Type,Variable Name [Units]{}", DataStringGlobals::NL);

print(state.files.mdd, "Program Version,{},{}{}", VerString, IDDVerString, DataStringGlobals::NL);
print(state.files.mdd, "Var Type (reported time step),Var Report Type,Variable Name [Units]{}", DataStringGlobals::NL);
Copy link
Contributor

Choose a reason for hiding this comment

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

@mbadams5 @Myoldmopar This reintroduced DataStringGloblas::NL which was removed in #8178. The rdd and mdd files now have an extra line ending character in the header line 0D 0D 0A. This causes text editors on Windows to prompt to fix line endings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) Performance Includes code changes that are directed at improving the runtime performance of EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate CSV hourly output directly from EnergyPlus (deprecate ReadVarsESO)

9 participants