Giter Club home page Giter Club logo

Comments (4)

ggventurini avatar ggventurini commented on May 22, 2024

Hi,

I can see what the problem is.

Simulations may generate a lot of data. The approach we take is that we
write the data to disk, and read it when the user accesses. If no output
file is specified, then a temporary one is created to hold the data. Many
OS's delete the temporary files when they are closed, so it's never closed,
and that indeed is a bug.

As a work-around, you may specify an output file. After the simulation is
run and you have processed your results, you may run a new one with the
same output file, (which will get overwritten).

Hope that helps for the time being. I will look into fixing the too many
open files issue soon.

How many files did you have open and what OS do you use? I'd have imagine
that number to be pretty high.

Cheers,

On Mon, May 18, 2015 at 6:34 PM, Ryan Kinnear [email protected]
wrote:

I am using Ahkab to model circuits for to test some optimization
strategies. So, I am running an Ahkab simulation hundreds or thousands of
times very quickly. This quickly leads to my program crashing due to having
too many open files. It turns out that every time I run an analysis, Ahkab
creates a file in /tmp/.

I've looked through the source and it seems that if you set "outfile" to
None in new_ac it will create a temp file for the output.

from ahkab.py, in each new_ function.

if guess is None:
    guess = options.dc_use_guess
if outfile is None or outfile == 'stdout':
    if options.cli:
        outfile = 'stdout'
    else:
        ofi, outfile = tempfile.mkstemp(suffix='.op')
        _of.append(ofi)  # keep the file open until quitting

The fd is stored in the _of list, but I haven't found anywhere they get
closed.

I also am unsure about why it's necessary to write to this temp file in
the first place?

As far as I can tell, there is no obvious way to disable writing to these
temp files.


Reply to this email directly or view it on GitHub
#30.

from ahkab.

RJTK avatar RJTK commented on May 22, 2024

I'm running Linux Mint 17 and it has about 1500 open files when it crashes.

from ahkab.

ggventurini avatar ggventurini commented on May 22, 2024

The latest master fixes the temporary files being left open. We still rely on the OS to clear /tmp from time to time, ie we still write files there.

I think this partially addresses your issue. Please let me know if it prevents the crashes you reported.

from ahkab.

RJTK avatar RJTK commented on May 22, 2024

It doesn't crash any more. It does still flood the /tmp/ directory, but that isn't really a bug. I think the best thing to do is for the user to just specify a hidden file for it to write to.

from ahkab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.