Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
1

Can anyone guide me on how EnergyPlus can be used for parallel processing?

asked 2024-12-18 04:10:55 -0600

MHW's avatar

updated 2024-12-19 10:21:39 -0600

Let's just say I have to run multiple copies of a same IDF, each with multiple (varying) inputs at the same time, just to quicken overall computation time, how can I do it using EnergyPlus?

I hope my question is clear.

=================================================================================

Edit-1:

I appreciate everyone's support and guidance below, thank you guys, this is really helpful.

I had come across a link:

https://bigladdersoftware.com/epx/doc...

It suggests to "... create multiple folders and copy files EnergyPlus.exe, Energy+.idd, DElight2.dll, libexpat.dll, bcvtb.dll, EPMacro.exe (if macros are used), ExpandObjects.exe (if HVACTemplate or Compact HVAC objects are used) from the original EnergyPlus installed folder. Inside each folder, copy IDF file as in.idf and EPW file as in.epw, then run EnergyPlus.exe from each folder ..."

I think this is done automatically by EnergyPlus via Group Simulations feature now (correct me if I am wrong).

However, I wanted to automate this via Python, as in put the above files in separate folders and run each IDF from Python EnergyPlus API. Anyone who has experience with something similar?

I see @Yapan has posted a solution along these lines, could you please advise on if you had to copy files as mentioned above?

edit retag flag offensive close merge delete

Comments

1

Hi, please see the comment below my answer.

Yapan's avatar Yapan  ( 2024-12-19 08:48:25 -0600 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2024-12-18 09:14:44 -0600

Greg Estep's avatar

I believe you are asking about parametric analysis, or using a simulation manager. I'm a design builder user, which has parametric analysis tools as well as a separate program called "simulation manager" that can run simultaneous simulations.

So, yes, you can run simultaneous simulations, but you will need to figure out how to launch them Perhaps: EP-Launch.

edit flag offensive delete link more

Comments

2

When using EP-Launch, make sure you change the "number of simultaneous processes" to be near the number of threads your CPU can provide. See View..Options..Command Window to set this.

JasonGlazer's avatar JasonGlazer  ( 2024-12-19 06:04:28 -0600 )edit
3

answered 2024-12-18 11:37:31 -0600

Yapan's avatar

updated 2024-12-18 11:39:04 -0600

I’m not familiar with running parametric analyses in OpenStudio or DesignBuilder, but here’s my approach for parallel processing using multiple CPU cores in a Windows/Linux environment with Python:

  1. Parameter Assignment: Write a function to apply specific parameters or inputs to your IDF file. And assign the correct Energy+.idd path. (see the EPPY library for reference).

  2. Temporary Workspace: Within that function, create random temporary folders to store copies of your IDF and EPW files for each run (see the tempfile module).

  3. Parallel Execution: Implement multiprocessing to run multiple simulations in parallel, leveraging all available CPU cores (see the multiprocessing module).

Note: Be sure to clean up by deleting all temporary folders and files once the simulations have finished. In Windows, the multiprocessing module was previously limited to a maximum of 64 CPU cores. I’m not sure if this limitation still applies.

edit flag offensive delete link more

Comments

1

@MHW If you only need to run simulations with varying parameters, rather than simulating different HVAC types, the proposed approach should work:

  1. Copy only the default IDF and EPW files into the temporary folder. Use EPPY to assign different parameters.
  2. There’s no need to copy any additional files, once you've specified the correct path to "Energy+.idd" within your Python code.

Make sure your Python function deletes all temporary folders and files once the simulations are complete.

I hope this helps.

Yapan's avatar Yapan  ( 2024-12-19 08:46:42 -0600 )edit

Hi @Yapan, thank you!

Couple of doubts:

  1. Shouldn't the Python script be specifying the path to each of the IDFs and corresponding EPW files placed in multiple folders?
  2. Is it needed to change the name of IDFs copied in multiple folders?
MHW's avatar MHW  ( 2024-12-19 11:11:06 -0600 )edit
1

Hi @MHW

  1. You’re correct—the Python function should specify the paths to both the IDF and EPW files in the designated folder.
  2. This isn’t an issue since the "tempfile module" automatically creates a unique directory. Both the IDF and EPW files will therefore have unique, identifiable paths.
Yapan's avatar Yapan  ( 2024-12-19 13:31:47 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2024-12-18 04:10:55 -0600

Seen: 54 times

Last updated: 2 days ago