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

#8376 - EnergyPlus with option --expandobjects set fails when working directory is not on the same device as the output directory (on Unix) #8410

Merged
merged 9 commits into from
Feb 11, 2021

Conversation

jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Dec 4, 2020

Pull request overview

This is a minimal fix for the specific moveFile issue that #8376 touches upon.

(I have spent a lot of time implementing a solution that makes use of C++17 std::filesystem, but I'm going to put up a NFP for this to see if I can get buy in first)

I added a bunch of new tests for FileSystem.unit.cc, including some that I commented out or adjusted because they currently fail (I think they shouldn't).

The specific issue for #8376 is not tested in a unit test... As it requires having an mount point, like a secondary hard drive or whatnot and we cannot ensure that the host running the test does have that. I have tested locally that this fixes it though.

I have a few other drives other than the one my OS (Ubuntu 18.04) is on, including one named 'DataExt4'. Before the fix, I can reproduce the issue as per below. After fix simulation works fine.

$ pwd
/home/julien/Software/Others/EnergyPlusDevSupport/DefectFiles/8000s

$ /bin/rm -Rf /media/DataExt4/Software/tmp/ && mkdir -p /media/DataExt4/Software/tmp/

$ energyplus -x -w /home/julien/Software/Others/EnergyPlus/weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw -d /media/DataExt4/Software/tmp/out-ori HVACTemplate-5ZoneVAVFanPowered.idf

ExpandObjects Started.
 Begin reading Energy+.idd file.
 Done reading Energy+.idd file.
ExpandObjects Finished. Time:     0.044
EnergyPlus Starting
EnergyPlus, Version 9.4.0-998c4b761e, YMD=2020.12.02 15:42
**FATAL:Input file path /media/DataExt4/Software/tmp/out-ori/eplusout.expidf not found
EnergyPlus Run Time=00hr 00min  0.10sec
Program terminated: EnergyPlus Terminated--Error(s) Detected

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

@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label Dec 4, 2020
@jmarrec jmarrec self-assigned this Dec 4, 2020
@nrel-bot-3
Copy link

@jmarrec @lgentile it has been 28 days since this pull request was last updated.

@Myoldmopar
Copy link
Member

@jmarrec if we push to file system library support, do you want this to drop in as a temporary fix first? Or just close this PR?

@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 13, 2021

@Myoldmopar I'd rather it gets in in the meantime, unless you see a reason not to? I fixed the conflict in the test.

@Myoldmopar
Copy link
Member

@jmarrec this does look good. Most of the changes are just adding the namespace obviously, with the one change in the rename section. I'm glad you are able to reproduce this error and the fix works. I would like to merge this in, but a few of the file system unit tests are failing with the last commit. If you can address that then I think this can drop in as an interim step toward the larger filesystem refactor.

@jmarrec jmarrec force-pushed the 8376_FileSystem_Move_minimal branch from 5f15aec to 5d2a5c3 Compare January 22, 2021 00:06
@jmarrec
Copy link
Contributor Author

jmarrec commented Jan 22, 2021

should be good now

@Myoldmopar
Copy link
Member

@jmarrec it looks like this still has a couple unit test issues.

@jmarrec
Copy link
Contributor Author

jmarrec commented Feb 11, 2021

@Myoldmopar CI looks happy now.

@Myoldmopar
Copy link
Member

All good, great!!

@Myoldmopar
Copy link
Member

Alright, with CI all happy here, I'm going to merge this one, along with the package fix in #8525. Then @lefticus will address any conflicts in his modernization branch, and then we'll get that merged as well.

Thanks for fighting through this, spotting issues, and fixing it all up, @jmarrec!

@Myoldmopar Myoldmopar merged commit aec9cc5 into develop Feb 11, 2021
@jmarrec jmarrec deleted the 8376_FileSystem_Move_minimal branch February 12, 2021 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
7 participants