Skip to content
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

Begin removing objexx gio #7668

Merged
merged 18 commits into from
Jan 10, 2020
Merged

Begin removing objexx gio #7668

merged 18 commits into from
Jan 10, 2020

Conversation

lefticus
Copy link
Contributor

@lefticus lefticus commented Jan 7, 2020

Pull request overview

Begins process of moving to a modern approach to formatting IO with using libfmt and reducing the number of globals.

This is an intermediate step with proof of concept and mixed global file handle / io stream.

The bulk of this change set is the inclusion of libfmt source .

NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE

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

@lefticus lefticus added the Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring label Jan 7, 2020
@Myoldmopar
Copy link
Member

This is a very exciting step. There does appear to be at least one file with diffs, with the EIO diffs being due to padding in numerical representation of some floating points. There are also a number of unit test failures that are likely due to similar changes. Fixing these should help define the types of changes we see from the change to fmt. I have no issues with the approach you are using for the OutputFiles as an intermediate step toward a utopian future with fewer globals. Let me know if you need anything as you get this in shape to be merged.

@lefticus
Copy link
Contributor Author

lefticus commented Jan 8, 2020

@Myoldmopar I'm going to have to investigate these failures, as I just ran the entire test suite on my system and had 0 failures. I'll get back to you.

@lefticus
Copy link
Contributor Author

lefticus commented Jan 8, 2020

Ahh, forgot to push latest commits. Sorry!

@lefticus
Copy link
Contributor Author

lefticus commented Jan 8, 2020

@Myoldmopar
I'll check into the EIO diffs. The only ones that I'm aware of are removal of incorrect trailing ,, but I can put them bacl

@Myoldmopar
Copy link
Member

@lefticus Custom check is complaining about the license year on the two new source files. I can update those if needed but I don't want to stomp on your commits if you are already doing other stuff.

@lefticus
Copy link
Contributor Author

lefticus commented Jan 9, 2020

@lefticus Custom check is complaining about the license year on the two new source files. I can update those if needed but I don't want to stomp on your commits if you are already doing other stuff.

@Myoldmopar I'll get it

@Myoldmopar
Copy link
Member

Wow those diffs are so close to being eliminated. One is just a whitespace diff and one is just the padding on the scientific notation exponent. I'm inclined to try it's equivalent anyway, but since I think it would just take a super minor tweak I guess we might as well get it to fully no diffs.

@lefticus
Copy link
Contributor Author

lefticus commented Jan 9, 2020

I'll fix the whitespace, not sure how that one sneaked in, but you're keeping that missing 0 in the exponent.

@Myoldmopar
Copy link
Member

@lefticus a branch was just merged that introduced a few diffs so I quickly pulled develop into this branch. Hopefully it caught it in time so CI won't waste an extra set of cycles. If it did, oh well.

@lefticus
Copy link
Contributor Author

@Myoldmopar quick merge it merge it!

@lefticus
Copy link
Contributor Author

@Myoldmopar IMO a squash merge is appropriate.

@Myoldmopar
Copy link
Member

Yep, this is a great push in the right direction. I think we can handle that one diff 🤣

image

Thanks @lefticus!

@Myoldmopar Myoldmopar merged commit 5b4a9ee into develop Jan 10, 2020
@Myoldmopar Myoldmopar deleted the remove_objexx_gio branch January 10, 2020 16:45
@mjwitte
Copy link
Contributor

mjwitte commented Jan 11, 2020

@Myoldmopar @lefticus Having trouble building unit tests on Win VS2019.

2>------ Build started: Project: energyplus_tests, Configuration: Debug x64 ------
2>ZoneTempPredictorCorrector.unit.cc
2>C:\MJW Git\EnergyPlus\third_party\fmt-6.1.2\include\fmt\core.h(266,1): error C2872: 'fmt': ambiguous symbol
2>C:\MJW Git\EnergyPlus\third_party\fmt-6.1.2\include\fmt/ostream.h(14,1): message : could be 'fmt'
2>C:\MJW Git\EnergyPlus\third_party\ObjexxFCL\src\ObjexxFCL/Array6S.hh(5139,11): message : or       'ObjexxFCL::fmt'
2>C:\MJW Git\EnergyPlus\third_party\fmt-6.1.2\include\fmt/format.h(2482): message : see reference to function template instantiation 'unsigned __int64 fmt::v6::internal::to_unsigned<__int64>(Int)' being compiled
2>        with
2>        [
2>            Int=__int64
2>        ]
2>C:\MJW Git\EnergyPlus\third_party\ObjexxFCL\src\ObjexxFCL/IndexSlice.hh(246): message : see reference to class template instantiation 'std::initializer_list<_Ty>' being compiled
2>        with
2>        [
2>            _Ty=int
2>        ]
2>C:\MJW Git\EnergyPlus\third_party\ObjexxFCL\src\ObjexxFCL/IndexRange.hh(114): message : see reference to class template instantiation 'std::initializer_list<ObjexxFCL::Index>' being compiled
2>Done building project "energyplus_tests.vcxproj" -- FAILED.

Tried deleting the build folder and a fresh build but still getting this error.

@Myoldmopar
Copy link
Member

@lefticus is there an auto that is ambiguous? @mjwitte it doesn't link you to an explicit line does it? The message above says ZoneTempPredictorCorrector.unit.cc but it doesn't give an exact line.

@mjwitte
Copy link
Contributor

mjwitte commented Jan 11, 2020

@Myoldmopar @lefticus Found the problem. ZoneTempPredictorCorrector.unit.cc is full of using statements and one of them is using namespace ObjexxFCL; Deleting that eliminates the ambiguity. I'll push up a cleanup branch shortly after some local testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants