First time here? Check our help page!
4

Is there a better way to get execution time than from eplusout.end?

I'm looking into the sensitivity of energy use and execution time to various parameters (timestep, surface convection, geometry level of detail, etc.). For this I need to save the execution time of each run.

As it stands I'm parsing the string in the eplusout.end file:

Elapsed Time=00hr 01min  1.00sec

But is there a better way? I've had a look in the SQLite file but can't see anything.

Jamie Bull's avatar
5.1k
Jamie Bull
asked 2016-05-17 04:39:10 -0500
edit flag offensive 0 remove flag close merge delete

Comments

1

I don't think there's a better way (and it's really easy to parse out a one-line file in this case), aside from saving your timestamp prior to simulation and then after it using the programming language you use to launch the simulation (I'm assuming you're using Python to launch your sims)

Julien Marrec's avatar Julien Marrec (2016-05-17 04:49:48 -0500) edit
add a comment see more comments

1 Answer

3

Here's the Python I'm using in any case:

import re

def get_execution_time(eplusend):
    """Get the execution time in seconds.

    Parameters
    ----------
    eplusend : str
        Path to the .end file.

    Returns
    -------
    float

    """
    with open(eplusend, 'r') as f:
        text = f.read()
    time = text.split(';')[-1]
    h, m, s, ms = [int(n) for n in re.findall('\d+', time)]
    secs = (h * 60 * 60 +
            m * 60 +
            s +
            ms / 100.0)

    return secs
Jamie Bull's avatar
5.1k
Jamie Bull
answered 2016-05-17 05:24:49 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments