Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple network scenario simulation - EPANET files remain open #22

Open
r-haider opened this issue May 15, 2017 · 4 comments
Open

Multiple network scenario simulation - EPANET files remain open #22

r-haider opened this issue May 15, 2017 · 4 comments

Comments

@r-haider
Copy link

Hi,

I'm working with your toolkit for analyzing different configurations within an existing hydraulic network. I generate different scenarios, model them in sequence, and then perform some analysis around the results from EPANET. However, I'm running into an issue with all the temporary files that must be created if a change is made to the network.

I am using the function ENsaveinpfile to save the changes I've made to an open network (I make all changes on this same open network), and then have to open the new file to run the simulation. - I follow the network change example you provide (thank you for the detail!)

However, since I run multiple scenarios, I end up generating many temporary files, and cannot continue beyond ~50 simulations as there are too many files open (I know I can increase the space allocated to temporary files, but this isn't a reasonable solution as I'll need to run 1000+ simulations).

I've taken a look at the source code, epanettools.py at the _close() function and see that you've noted there is a bug. I've also tried to manually force a file close or remove (see list below), but get Windows 32 error (file cannot be accessed because it's being used by another process).

  1.    new_solver._close()
    
  2.    new_solver.ENclose()
    
  3.    os.remove(new_solver.rptfile)
    

Is this a bug that you will be working to address soon (I'm nearing the end of my project timeline and I would need this bug fixed), or have you been able to find a workaround that doesn't involve excessive memory allocation?

@asselapathirana
Copy link
Owner

asselapathirana commented May 16, 2017 via email

@AMahajna
Copy link

AMahajna commented Jun 9, 2019

r-haider, where you employing coupled simulation-optimization? Where you able to increase the number of simulations by employing multiprocessing successfully?

@asselapathirana
Copy link
Owner

asselapathirana commented Jun 11, 2019 via email

@AMahajna
Copy link

Dear Sir,
Thank you so much for your valuable contributions!
Indeed, multiprocessing solves the issue. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants