Re: F2PY: Access Fortran module data from multiple python module

Discussion in 'Python' started by Gabriel Genellina, Nov 21, 2008.

  1. En Wed, 19 Nov 2008 20:06:37 -0200, Yann Vonder
    <> escribió:

    > Here is a description of what I am trying to implement using F2PY:
    > I have created two python extension modules using F2PY. The first
    > extension
    > module (say fsubr1.so) contains a Fortran module (say "tmod") and a
    > subroutine (say "subr1") that modifies the data contained in "tmod". The
    > second extension module (fsubr2.so) contains the same Fortran module as
    > fsubr1.so (tmod), and a different subroutine ("subr2") that also modifies
    > the data contained in "tmod". I am hoping to be able to have fsubr1.so
    > and
    > fsubr2.so share the content of "tmod," in a way that if a call is made,
    > from
    > python, to "subr1", followed by a call to "subr2", both subroutine access
    > the same data contained in "tmod". Unfortunately, if I run the Python


    If you put tmod in both libraries, you'll have two copies of it, and two
    copies of the data. Can't you join both libraries onto a single one? Or
    make one load the other? Or avoid global variables, and pass the required
    data to the subroutines? Either way, this is a design problem that you'll
    have to solve on the Fortran side, not in Python.

    --
    Gabriel Genellina
    Gabriel Genellina, Nov 21, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus Faust
    Replies:
    2
    Views:
    747
    Markus Faust
    Nov 3, 2003
  2. M. Faust
    Replies:
    6
    Views:
    506
    Robert Kern
    Sep 28, 2004
  3. Guest

    Re: [f2py] f2py problem

    Guest, May 15, 2007, in forum: Python
    Replies:
    0
    Views:
    580
    Guest
    May 15, 2007
  4. Blubaugh, David A.

    F2PY ?? Has anyone worked with the F2PY generator?

    Blubaugh, David A., Sep 8, 2008, in forum: Python
    Replies:
    0
    Views:
    258
    Blubaugh, David A.
    Sep 8, 2008
  5. tripp
    Replies:
    4
    Views:
    860
    tripp
    Feb 14, 2009
Loading...

Share This Page