gaurav306 / synconn_build

synconn_build: Synthetic dataset generator for testing control-oriented neural networks for building dynamics
MIT License
3 stars 0 forks source link

synconn_build on Linux #1

Closed fremk closed 9 months ago

fremk commented 10 months ago

Hello, I was wondering if you have any tips on how to run your code on Linux. Currently, I adapted the code using wine to run the .exe and .bat files but it is a bit complicated; plus I'm running into multiple pathing problems because of that. Any help would be appreciated! Best, Karim

gaurav306 commented 10 months ago

Hi, Could you let me know more details about what problems (pathing or others) you are facing? I think the major issue one can face is running EnergyPlus itself in Linux.

regards Gaurav

fremk commented 10 months ago

That's true, I noticed that the majority of simulations software are adapted to Windows. But anyway, the Run_main.py runs now after I fixed the pathing issue (which consisted of replacing / and \ depending if I need the path under wine or not) and the .bat and .exe scripts issues. Having mentioned that, there are still some missing files, as seen in the snapshot below GHTIn.idf & BasementGHTIn.idf (I'm only trying to run the code as is with the default 5Zone_obFMU.idf file and config). I'm not quite sure where to get these files from nor where I should place them. image Edit: I forgot to mention that I am using EnergyPlus-23-2-0, would that cause any problems? (I fixed the verification process that checks if EnergyPlus-22-1-0 is installed or not, so besides that)

gaurav306 commented 10 months ago

Suggestions: If you check https://github.com/gaurav306/synconn_build/blob/68ee52f2f132c10edc6a274432c8d1a4f42163a0/src/RunEPlus_template.bat#L231 and https://github.com/gaurav306/synconn_build/blob/68ee52f2f132c10edc6a274432c8d1a4f42163a0/src/RunEPlus_template.bat#L263 they require .exe of basement and slap processor. Anyway as these are not important for synconn_build, you can comment everything from line 218 to 277 in your local copy of src/RunEPlus_template.bat

PS: if you want to run newer Energyplus, you "MIGHT" have to convert all the template .IDF files to newer .IDF. I would say first try with newer EP without conversion.

fremk commented 10 months ago

Still shows the same error even after removing lines 218 till 277 in RunEPlus_template.bat. I'm trying to find where these .idf files are used (in InputProcessor.f90) and their path, but I don't know where I could get them from, if possible, to fix the issue. Should they be available on the repo?

gaurav306 commented 10 months ago

Remove same lines from .bat files in this folder also, https://github.com/gaurav306/synconn_build/tree/main/src/OB_GEN/src/simfolder

These are EnergyPlus related files and not specific for synconn_build.

fremk commented 10 months ago

This ended up working, thank you. Now that I have no problem with EnergyPlus nor the fact that I am using Linux, I still run into a problem while running the code: FileNotFoundError: [Errno 2] No such file or directory: Dataset_outout/NOR_TD_012730/sample_test_0_10/temp/NOR_TD_012730_EnergyPlus_file_0.csv

This error comes from src/EP_Generator.py, shutil.copyfile(src,dst)

src = sim_temp_dir + r'/%s.csv' % bat_idf_name
dst = sim_dir + '/' + '%s_%s_output.csv' % (city_name , sim_number)

shutil.copyfile(src, dst)

os.remove(sim_temp_dir + r'/%s.csv' % bat_idf_name)
os.remove(sim_temp_dir + r'/%s.err' % bat_idf_name)

Isn't the script supposed to generate (and then remove) this file by itself? Edit1: The script is not generating any output file to begin with. Only generates the Signalinputs$.csv. 'src/OB_GEN/src/output_IDF.csv' is never generated. I think it's most probably because of a pathing/file naming issue (mainly due to the difference between Windows and Linux). Can't seem to get a hold of it. Edit2: the output_IDF.csv is supposed to be generated using the RunEPlus.bat file right? I can't find anything related to output_IDF.csv in the mentioned .bat file.

fremk commented 9 months ago

Hello @gaurav306, I stopped trying to make it work on Linux as it seems to be a pain to do so :sweat_smile:. It fully works on a Windows VM though, although for some reason for timestep 5 and 6 in the config file, the script does not generate the final _output.csv file. It gives the error _EnergyPlus_file_0.csv not found. Works just fine for the rest of the timesteps (1 through 4). Thought I'd let you know.

Thank you for your assistance!

gaurav306 commented 9 months ago

Thanks for letting me know. I thought it would work for all timesteps. I will debug more and let you know here if I have fixed it. Good that you managed. Yes with Linux its different, the way folders and paths are set up have to be changed. best, Gaurav