meta data for this page
Use JESS Client with EP-Launch
The EnergyPlus EP-Launch program is very convenient for running single or multiple E+ simulations. It uses a batch command file named Epl-run.bat in the EnergyPlus folder. Making EP-Launch to run simulation on JESS instead of on your own computer is very easy. This page explains the steps for Windows users. If you are using Linux or Mac, the process will be fairly similar.
Follow these steps to link EP-Launch to the JESS service:
- Download a suitable JESS Client package from the download page. If you are using Windows and are unsure about whether Java is available, get the
jess_client_v2.0.0_jre_for_windows.zip
package. - Unpack it in your computer, say to the
C:\JESS_Client_v2.0.0_JRE_for_Windows\
folder. For convenience, rename the folder toC:\JESS_Client\
. - Go to the EnergyPlus folder, e.g.
C:\EnergyPlusV8-2-0\
, and locate theEpl-run.bat
file. - Edit this file using a text editor (Notepad++ is a good one), and make the changes described in the next section.
- Alternatively, copy and paste the
Epl-run.bat
andEpl-run.original
files from theC:\JESS_Client\scripts\
folder to the EnergyPlus folder. These scripts assume that the Client is installed atC:\JESS_Client\
, and are suitable for E+ v8.1 and v8.2. - That's about it.
Make changes to Epl-run.bat
EnergyPlus EP-Launch program uses EPL-run.bat
to execute simulations. The batch file contains all steps for staging a simulation, running pre-processes and post-processes as required. The JESS Client's command-line can be used to replace the call to EnergyPlus.exe in the batch file, so that the main simulation step will be sent to the JESS server. Since the JESS Client has been configured to behave just like EnergyPlus.exe
, there are very few things need to be changed in EPL-run.bat
.
Here is an exertion of the original EPL-run.bat:
: 4. Execute EnergyPlus SET EP_OMP_NUM_THREADS= IF "%cntActv%" == "" SET cntActv=1 IF NOT %cntActv% == 1 SET EP_OMP_NUM_THREADS=1 IF %multithrd%==N SET EP_OMP_NUM_THREADS=1 "%program_path%EnergyPlus" if %pausing%==Y pause ...
Here is EPL-run.bat injected with JESS Client:
: 4. Execute EnergyPlus SET EP_OMP_NUM_THREADS= IF "%cntActv%" == "" SET cntActv=1 IF NOT %cntActv% == 1 SET EP_OMP_NUM_THREADS=1 IF %multithrd%==N SET EP_OMP_NUM_THREADS=1 rem ...commenting out the original E+ call rem "%program_path%EnergyPlus" rem ...check if user has logged on to JESS java -jar C:\JESS_Client\JESS_Client.jar -cfg C:\JESS_Client\client.cfg -log C:\JESS_Client\log4j.cfg -logon rem ...submit job java -jar C:\JESS_Client\JESS_Client.jar -cfg C:\JESS_Client\client.cfg -log C:\JESS_Client\log4j.cfg -job ./ -type STD_SINGLE_JOB -output ./ if %pausing%==Y pause ...
java -jar …
at the beginning of line 332 and 334 should be replaced with C:\JESS_Client\Java\jre7\bin\java -jar …
.
Importantly, there is a “bug” in the Epl-run.bat that will cause remote simulation to fail. It has to be rectified as below.
... if exist expanded.idf MOVE expanded.idf in.idf if not exist in.idf copy "%epin%.idf" In.idf :if %pausing%==Y pause : 3. Test for weather file type and copy to working directory if %eptype%==EP copy "%epwthr%" In.epw : Convert from an extension of .epw to .stat if %eptype%==EP SET wthrstat=%epwthr:~0,-4%.stat if %eptype%==EP copy "%wthrstat%" in.stat :if %pausing%==Y pause ...
Rename In.idf
in line 252 and In.epw
in line 256 to in.idf
and in.epw
, respectively as below:
... if exist expanded.idf MOVE expanded.idf in.idf if not exist in.idf copy "%epin%.idf" in.idf :if %pausing%==Y pause : 3. Test for weather file type and copy to working directory if %eptype%==EP copy "%epwthr%" in.epw : Convert from an extension of .epw to .stat if %eptype%==EP SET wthrstat=%epwthr:~0,-4%.stat if %eptype%==EP copy "%wthrstat%" in.stat :if %pausing%==Y pause ...
You can add further cleaning up actions as below. These are optional, though.
: 8. Clean up directory. IF EXIST eplusout.inp DEL eplusout.inp IF EXIST eplusmtr.inp DEL eplusmtr.inp IF EXIST in.idf DEL in.idf IF EXIST in.imf DEL in.imf IF EXIST in.epw DEL in.epw IF EXIST in.stat DEL in.stat IF EXIST eplusout.dbg DEL eplusout.dbg IF EXIST test.mvi DEL test.mvi IF EXIST expandedidf.err DEL expandedidf.err IF EXIST readvars.audit DEL readvars.audit IF EXIST sqlite.err DEL sqlite.err IF EXIST utilSocket.log MOVE utilSocket.log testsocket.log : Delete FMUs files and folder --Added for FMI : IF EXIST *.mat DEL *.mat : IF EXIST *.fmu DEL *.fmu IF EXIST tmp-fmus rmdir tmp-fmus /Q/S REM clean up JESS files IF EXIST client.log DEL client.log IF EXIST job.done! DEL job.done! IF EXIST JobRecords.xml DEL JobRecords.xml IF EXIST time_stamps.txt DEL time_stamps.txt IF EXIST client.err DEL client.err ...
You can use similar method to insert JESS Client into other batch file-based programs, such as GenOpt (see Use JESS Client with GenOpt).
A video demo made for earlier versions of the JESS Client is available here: