[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EnergyPlus_Support] Re: Parametric run threading

yeah, the GenOpt code is somekind of dense... but in case you want to run it on windows the .bat file that comes with GenOpt can save you some time. 

multiple energy plus simulations can be executed at the same time in the mac version ( I assume that also applies to the unix version). Just make sure that you copy your batch.idf file for each thread that you start in a unique folder to avoid that different threads access the same simulation, or overwrite any files from another simulation. (the great risk of multi threading). You will be responsible in your java code to make sure that not more simulations are started than cores available. In the pseudocode I gave you previously (and in my code) I implemented it the greedy way. There are several thread pools for java available, that might be more appropriate to run it on a cluster than my home made suggestion :-). 

You might wanna do a test on your cluster, if you gain anything from starting more threads than cores.

This is the java function how I start a simulation if energy plus is installed on the system locally.

 private void startSimulation_mac(String uniqueFolder){

        Process proc;

        String cmd[]=new String[3];

        cmd[0] = "runenergyplus"; 
        cmd[1] = "resources/temp/"+uniqueFolder+"/batch.idf";
        cmd[2] =  sim.getWeatherFile();


               System.out.println("simulation started");

               Runtime rt = Runtime.getRuntime();
               proc = rt.exec(cmd);
               BufferedReader std = new BufferedReader(new InputStreamReader(proc.getInputStream()));

               String s=null;

               while ((s=std.readLine())!=null){
                   System.out.println(s); // prints out what you usually see in the command line.

                    try {
                    } catch (Exception e){
                        System.err.println("problem with process");
                        error = true;

             } catch(IOException e){
                    error = true;


have fun, and don't get a thread "knot"...



Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The primary EnergyPlus web site is found at:

The group web site is:

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.
Yahoo! Groups Links

<*> To visit your group on the web, go to:

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    (Yahoo! ID required)

<*> To change settings via email:

<*> To unsubscribe from this group, send an email to:

<*> Your use of Yahoo! Groups is subject to:

Email scanned by PC Tools - No viruses or spyware found.
(Email Guard:, Virus/Spyware Database: 6.17200)