-
Notifications
You must be signed in to change notification settings - Fork 389
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
JSON input format and InputProcessor refactor #5893
Conversation
1 test passes, other still fail. I need more information on knowing how to fix the rest
…_idf, and fixed assert_false to assert_true in 2 unit tests Also changed expect_true(ErrorsFound) for expect_false, cause we have warning not an error now
…s. Remove CheckCachedIPErrors function that checked a file that was unused, as well as commenting out other read / write checks on that file.
…get stored in son format
…ctor Update input_processor_refactor with the newest develop
…RIC/EnergyPlus into input_processor_refactor Merge newest develop into input_processor_refactor
…ate error streams
…d be more consistent. Reduce the total amount of map lookups as much as possible in the first half of GetObjectItem (alpha field and extension field iteration). This halfway refactored function is running faster in the profiler already
…at in one out of 4 cases if we don't do it in all 4
Testing to see performance impact since names are inherently unique now due to JSON keys
…T_TRUE in a unit test
…hange the way add_missing_field_value works in the interest of increased efficiency
… needed since the addition of the non-special cased Version Energy+ object
This reduces the algorithmic complexity of GetFooInput (really GetObjectItem) from O( n ^ 2 ) to O( n log n ). This has a dramatic effect on runtime for GetObjectItem function. We initially thought incrementing an iterator would be constant time operation but since this is a map, it is actually linear. This commit changes it to log time lookup.
…f std::pair and json::const_iterator copies, from input_processor_refactor_performance branch
This reverts commit 53d87e9.
Verification about reverting success: https://gist.github.com/Myoldmopar/aaace5182721a1126654f620c53f55a7 |
Yeah! 1 Test has big ESO diffs! I'm looking at those diffs now. |
@Myoldmopar Are the Std 62 changes present in both? I merged that into develop in the middle of all this. |
I was just discussing that with @mbadams5. That could definitely be a part of it, but I'm not sure I had pulled the 62.1 into my local develop yet. He's going to be pushing up potentially "final" changes after he merges develop and resolves conflicts. I'll pull immediately and compare to the latest develop at that time. |
@mbadams5 There may be one more merge going into develop,shortly #6454 @Myoldmopar will decide. |
Good point @mjwitte. As soon as @nrel-bot-3 gets done with its build of 6454 and it looks good, I'll merge it in. That will shut the door to everything except JSON. |
…idd-parser-w-coil
I verified locally that single remaining ESO diff is now gone. |
Good to go! Merging!! |
This introduces JSON as the new preferred input format. EnergyPlus will still accept IDF input for a TBD number of future releases. Developers will add and change the Energy+.idd until IDF is no longer accepted for input. There is a python script that is built into the build process that converts the IDD to JDD automatically.
To reduce the amount of code changes needed, all InputProcessor functions maintain their signatures and return the same data format, however, they parse and query against the JSON data structure internally. Through our refactoring efforts, we found two functions in InputProcessor that causes O( n^2 ) complexity and were able to change it to O( n ), due to amortized O(1) lookup with
unordered_map
. The table below shows this speed up for two different files; one reference building and one worst case input with an extreme number of surfaces (45,382 in 80 zones vs 871 in 118 zones). The table also shows the speed up in ProcessInput, parsing input, and parsing schema.We are using the JSON for Modern C++ library to parse and our own custom JSON Schema validator for validation.
*** NOTE ***
This requires the update to MSVC 2015 so we need to move CI machines and windows developers to Visual Studio 2015. This should be done anyways since MSVC 2015 is C++11 feature complete.
Work Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Review Checklist
This will not be exhaustively relevant to every PR.