Skip to content

Commit

Permalink
Clarify limitation about single process on windows/mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Nov 3, 2020
1 parent 8cb311e commit a8667b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ There are two ways to install this tool:
- Obviously the user will need the existing Python install, but other dependencies are automatically installed by Pip.
- Once installed into the Python install, there will be a binary available to run: `eplus_regression_runner`.

### Limitations

There are a couple limitation "gotchas" in here, however. A couple statements ahead of this:
- When we create the standalone installer, we use `pyinstaller` to _freeze_ the program and all dependencies.
- When we run EnergyPlus, we have to run in multiple processes, not just multiple threads, because of thread-unsafety within EnergyPlus itself.

There is an issue with the combination of these two things that cause the program to not work well on Windows and Mac.
If you try to freeze the program but use the multiprocessing library to create child instances, it fails.
There are notes on the web about how to remedy this by calling special functions at the entry of the code, but I could not get them to work fully.
So for now, if you use the frozen downloadable version of the program on Windows or Mac, it will not run EnergyPlus in multiple processes.

However, if you install the library into a Python install using Pip, the program is never frozen using `pyinstaller`, and seems to work just fine across platforms even with multiprocessing.
The best install path is to run in that fashion, but if you cannot, you can download the frozen version and just accept the single process for now.

## Development

For setting up a development environment to do _work_ on this tool, the steps are pretty minimal:
Expand Down
2 changes: 1 addition & 1 deletion epregressions/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def run_build(self, build_tree):
# `apply_async` approach I am using. Blech. Once again, on Windows, this means it will partially not be
# multithreaded.
if frozen and system() in ['Windows', 'Darwin']: # pragma: no cover -- not covering frozen apps in unit tests
self.my_print("Ignoring num_threads on frozen Windows instance, just running with one thread.")
self.my_print("Ignoring num_threads on frozen Windows/Mac instance, just running with one thread.")
for run in energy_plus_runs:
ep_return = self.ep_wrapper(run)
self.ep_done(ep_return)
Expand Down

0 comments on commit a8667b1

Please sign in to comment.