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

How to block the 'EnergyPlus Run Status' dialogue in group simulation

asked 2018-01-09 00:58:59 -0600

Mark Kou's avatar

updated 2018-01-10 10:13:56 -0600

Hi, everyone.

I'm running group simulations with EnergyPlus 8.8. The group includes 1008 IDF files. After running about each 50 IDF files, the 'EnergyPlus Run Status' dialogue (showing the numbers of warming & errors, elapsed time) pops up. The simulation pauses and will not continue until I clicked the OK button.

This problem keeps me beside the computer, and I cannot leave the simulation running for the whole night. So, is there anyway to block this dialogue from popping up?

Thank you.

edit retag flag offensive close merge delete

Comments

That should not be happening so you might want to post a bug report here. Have you looked at script-for-multiple-simulations?

JasonGlazer's avatar JasonGlazer  ( 2018-01-09 09:28:38 -0600 )edit

Thank you, Joson! Python is a good choice. I've made it.

Mark Kou's avatar Mark Kou  ( 2018-03-04 18:55:41 -0600 )edit

@Mark Kou I am having this exact problem for EnergyPlus 9.3 on our 16 core Windows Server OS. Unfortunately, I cannot easily use a python script like @JasonGlazer recommended because each IDF is paired with an EPW and the parametric generation pairs runs with some technologies in some climate zones, but not others, like heat pump water heaters in Miami vs New York, so the IDFs and EPWs pairs don't follow a simple pattern. Did you ever submit an issue on github?

mldichter's avatar mldichter  ( 2020-06-12 16:51:28 -0600 )edit

@JasonGlazer I am able to reproduce the behavior consistently. The problem goes away if the individual simulations take longer to run, like a run period of one week vs one year. A strange thing I noticed is new simulation terminals take a while to display for the one week run period. I allow my server to run 24 simultaneous IDFs, but there are usually only 2 or 3 simulation terminals, and sometimes zero simulations running. Looks like the interruptions occur when there are no simulations running for half a second (best guess). Does the code use the nonexistence of running simulations to exit?

mldichter's avatar mldichter  ( 2020-06-12 17:14:20 -0600 )edit

@mldichter you may be right, EP-Launch does use a timer to manage the queue of simulations and if simulations run for a very short time, that process may get messed up. I do believe the timer is set to 0.5 seconds. I am not sure that is responsible for the issue you are seeing but it is very likely related. Unfortunately, I'm not sure I can change that timer without it creating other issues. I would encourage you to reconsider using Python or another scripting tool to run simulations. You can certainly pair weather files with specific simulations.

JasonGlazer's avatar JasonGlazer  ( 2020-06-18 06:12:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-06-19 20:03:16 -0600

mldichter's avatar

I got something working in python with a few blemishes. Python's recommended subprocess was interfering with multiprocessing, so I had to use the ill advised os instead.

rungroup.py

from multiprocessing import Pool
import os
import time

def run_energyplus_cmd(command_string):
    print('starting ' + command_string)
    start_seconds = time.time()
    os.system(command_string + ' >NUL 2>&1') #concatenated string for suppressing energyplus output
    elapsed_minutes = int((time.time() - start_seconds)/60*100.0)/100.0 #two decimal places
    print(str(elapsed_minutes) + ' min for ' + command_string)

if __name__ == '__main__':
    number_of_simultaneous_simulations = 4

    #read commands.txt and split lines into array
    commands_file = open('commands.txt', 'r')
    commands_array = commands_file.read()
    commands_file.close()
    commands_array = commands_array.splitlines()

    #run all commands in parallel up to number_of_simultaneous_simulations at a time
    with Pool(number_of_simultaneous_simulations) as p:
        p.map(run_energyplus_cmd, commands_array)

    #using energyplus on the command line versus EP-Launch had different output
    #cmd made <idf_name>out.eio but EP-Launch made <idf_name>.eio output files
    #this is to remove all the "out" strings from the output files
    folder = 'runs'
    for filename in os.listdir(folder):
        filename = os.path.join(folder,filename)
        if not os.path.isfile(filename): continue
        new_filename = filename.replace('out.', '.')
        try:
            os.rename(filename, new_filename)
        except WindowsError:
            os.remove(new_filename)
            os.rename(filename, new_filename)


Here is my file organization. Folder "runs" contains all my IDFs, "weather files" contained my EPWs, and commands.txt contains the Windows cmd input. image description

image description

commands.txt

C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run0 -d runs runs/run0.idf C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run1 -d runs runs/run1.idf C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run2 -d runs runs/run2.idf C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run3 -d runs runs/run3.idf C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run4 -d runs runs/run4.idf

Lastly, the output.

C:\Users\<YOUR NAME>\Desktop\multiprocessing>python rungroup.py
starting C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run0 -d runs runs/run0.idf
starting C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run1 -d runs runs/run1.idf
starting C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run2 -d runs runs/run2.idf
starting C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run3 -d runs runs/run3.idf
0.26 min for C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run2 -d runs runs/run2.idf
starting C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run4 -d runs runs/run4.idf
0.27 min for C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run3 -d runs runs/run3.idf
0.27 min for C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run0 -d runs runs/run0.idf
0.27 min for C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run1 -d runs runs/run1.idf
0.16 min for C:/EnergyPlusV9-3-0/energyplus -w "weather files/CZ03/CZ03.epw" -p run4 -d runs runs/run4.idf

C:\Users\<YOUR NAME>\Desktop\multiprocessing>

image description

edit flag offensive delete link more

Comments

Interesting answer. I wonder if the question and title should be changed to match it?

JasonGlazer's avatar JasonGlazer  ( 2020-06-23 06:25:07 -0600 )edit

@JasonGlazer Eh... Using EP-Launch is much easier. Even writing the energyplus run group file is easy with a script. This solves the OP's problem, but it's still a kluge. I could see this being useful with some modifications to run on a DIY high performance computer setup, but then there's Slurm for actual high performance computers.

The one nice feature is the combined error file is not generated. Running 10,000 simulations made this huge error file and adding to the error file seemed to go slower and slower as the file size increased with each simulation.

mldichter's avatar mldichter  ( 2020-06-23 13:59:11 -0600 )edit

One other nice benefit of using the python script versus the built in run group approach is the python script can handle relative addresses in the file names and energyplus could only use absolute addresses. That has been an inconvenience in testing batch runs locally then transferring them onto a much faster computer, but with the python, it's just copy, paste, run.

mldichter's avatar mldichter  ( 2020-07-14 14:40:42 -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: 2018-01-09 00:58:59 -0600

Seen: 339 times

Last updated: Jun 19 '20