First time here? Check our help page!
2

Parallelization of EnergyPlus simulations and ExpandObjects error

I'm running EnergyPlus simulations using subprocess.call() in Python and it all works well when I run the simulations one by one in some kind of a for loop. However, I wanted to run multiple simulations at once using multiprocessing or joblib.Parallel and I keep getting an error related to ExpandObjects. Somehow the preprocessing is not performed for some of the .idf files and the .expidf file is not created, resulting in a fatal error. Interestingly, some of the simulations are completed successfully, so it seems to be related with the way the parallelization is done. I tried to play with different parameters (e.g. backend implementation type) but it didn't help.

The problem disappears when I use just one core by setting joblib.Parallel(n_jobs=1), but of course it makes the whole parallelization useless.

kamilitsa's avatar
23
kamilitsa
asked 2020-05-21 12:22:13 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Are you using the command line to run ExpandObjects using -x option or are you using the RunEPlus.bat file or something else?

JasonGlazer's avatar JasonGlazer (2020-05-22 08:09:58 -0500) edit

I'm using subprocess.call() with -x option included

kamilitsa's avatar kamilitsa (2020-05-24 17:10:14 -0500) edit
add a comment see more comments

1 Answer

2

You might want to try using ExpandObjects as a first step on all your files to create all the detailed HVAC IDF files one at a time, not in parallel. ExpandObjects uses specific file names that are probably being overwritten when used in parallel. Fortunately, ExpandObjects runs quickly.

JasonGlazer's avatar
6.8k
JasonGlazer
answered 2020-05-25 08:28:48 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks so much, it worked! It didn't occur to me that you could run ExpandObjects by itself and only then run the simulations. And indeed, it runs quite fast, so it's not an issue that this part is not parallelized.

kamilitsa's avatar kamilitsa (2020-05-25 12:04:24 -0500) edit

The alternative is to restructure your project and work in unique subfolders. instead of having all .idf in the same folder and calling energyplus -x -d {unique_name} {unique_name}.idf, do something like mkdir {unique_name} && mv {uniqe_name}.idf {unique_name}/in.idf && cd {unique_name} && energyplus -x

Julien Marrec's avatar Julien Marrec (2021-07-29 08:23:52 -0500) edit
add a comment see more comments