Error: Cannot write to simulation log file in bcvtb while using energyplus

asked 2018-01-23 05:54:21 -0500

Akash's avatar

updated 2018-01-23 23:33:45 -0500

I am using bcvtb software as interface between a python code and energyplus. In the ptolemy model being used i have 2 actors ( one for the python code and other for the enegyplus software ) who write information to each other and execute alternatively. The log files for the two have been named differently ( simulation.log and simulation5.log ). I am encountering the following error on carrying out the bcvtb simulation:

image description

This error is probably not due to the modeling or code but might be arising due to some other conflict however i am not sure. Sometimes the execution runs smoothly but many times above dialogue box pops up. Why does this happen?

Edit: Is it possible that the multiple runs of the software leave something running in the background that is causing inconsistency and hence leading to the error ?

edit retag flag offensive close merge delete

Comments

As a workaround, Run the BCVTB as an Administrator, it should work. I don't really see why you'd have permissions problems on your desktop though. Is the log being used by another program?

Julien Marrec's avatar Julien Marrec  ( 2018-01-23 06:21:36 -0500 )edit

I don't think so. This is the only program i am running. However i've noticed that stopping the simulation via bacvtb does not shut down the energyplus simulation which goes on for some time. Is it possible that there is some program running from previous simulations or something? Also till now i used to first run the bcvtb.jar file. Then using the gui which would open i would open and run my .xml file. There is no option to run the bcvtb.jar as an administrator. Is there some other way that i must try?

Akash's avatar Akash  ( 2018-01-23 06:26:25 -0500 )edit

@Akash, launch a terminal an Admin (such as cmd.exe - find it in the list of programs, right click > run as admin), then go launch the bcvtb.jar. It's possible your E+ simulation that wasn't stopped could be using it... But if you reboot your machine (or kill all E+ processes), then try again, you shouldn't get this error anymore in that case. Did you try? Is the error still there?

Julien Marrec's avatar Julien Marrec  ( 2018-01-24 08:21:15 -0500 )edit

@Julien I did launch the terminal as an admin from where i ran the jar file, however the error persisted. Regarding the E+ processes, it does run for some extra time till the simulation is complete. During this period i am unable to delete any of the E+ output files as it says they are being used by the program. But the E+ program completes after some time as a proof of which i am able to delete the E+ output files. This error also arises after the simulation has run for some time. Is there anything else that i can try?

Akash's avatar Akash  ( 2018-01-29 02:43:14 -0500 )edit
1

Hum, system.SystemCommand makes me think that simulation5.log is being written to by Python, is that correct? You are launching an external system command which runs your python script, but you may not be waiting for it to complete, and therefore it is possible you have two external python script trying to write at the same time... Perhaps you should share your project files?

Julien Marrec's avatar Julien Marrec  ( 2018-01-29 02:59:50 -0500 )edit

@Julien Because i'm working as an intern at a company i'm not allowed to share the source. Also the actor relates to a python code but in the code that i have written nothing is written to the simulation5.log. What is it that writes to the log file? I had a doubt regarding this. The python code is being run again and again but how is it possible for the python code to be run when it hadn't completed previously. Could you please provide an insight on when the control moves from the actor of the python code to the actor of the E+ program. Doesn't it wait for the python code to complete?

Akash's avatar Akash  ( 2018-01-29 03:06:47 -0500 )edit

If you are spawning an external shell to run your python code, it doesn't necessarily wait for it to complete no. Depends how your project is setup (what actor is calling what and with which command). There are many ways to skin a cat in this case, that's why I was asking for your project files (you can create a Minimum complete and Verifiable Example, I don't need your actual, proprietary, project files).

Julien Marrec's avatar Julien Marrec  ( 2018-01-29 03:24:47 -0500 )edit

One example: Because Ptolemy uses Jython, and because Jython doesn't have many scientific packages that I like to use, I had to resort to calling my system python before so I could use the packages such as numpy, pandas, scikit-learn. I was using a python actor calling my system python... In such a case it's critical to call system python using an appropriate caller that will wait for completion... (such as subprocess.call)

Julien Marrec's avatar Julien Marrec  ( 2018-01-29 03:26:23 -0500 )edit
1

We're flooding the comment box, I suggest you join the Unmethours slack channel to discuss this, see my answer here for instructions.

Julien Marrec's avatar Julien Marrec  ( 2018-01-29 03:28:22 -0500 )edit