Giter Site home page Giter Site logo

Comments (2)

rosenbrockc avatar rosenbrockc commented on July 25, 2024

Instead, stop caching the shared library DLL instances created by python in static_symbol. If we get a new library instance each time, it should have its own memory and then the current paradigm would work correctly. In that case, the overhead would move to the shared library loading. I don't see another way around this that doesn't involve double allocation of arrays in memory and copying values over.

from fortpy.

rosenbrockc avatar rosenbrockc commented on July 25, 2024

For now, I decided to implement a full array copy to bypass this problem. It turns out that the ctypes library loading returns the same handle to each subroutine; loading the library again does not allow a separate block of memory to be allocated for the subroutines. This seems to be an inherent problem with the ctypes implementation and the fundamental differences between C and Fortran.

Andrew will look into creating a C++ wrapper to act as intermediary between F and C via ctypes. For now, revision 1.5.1 has the updates for safe memory access and deallocation by copying arrays lazily when a subroutine is requested an additional time. I will update this once he has looked into that.

from fortpy.

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.