[f2py] fortran and python threads

Mark Andrews andrews.markw at gmail.com
Wed Dec 1 04:48:00 EET 2010


Hi all (I'm new to posting to the list, but have been subscribed for a while),
Is it possible to run a f2py wrapped fortran subroutine alongside a
regular old python thread and for them to access the same variables? I
don't really know much about threading in python, but I've heard about
some issues with an interpreter lock.
In my porblem, I have a fortran gibbs sampler. I would like a python
thread to regularly read its "state" (read the values of some arrays)
as it runs and write it to a database. Does that sound like something
easy or painful?
More generally, I often use openmp inside fortran code, but never have
wrapped these with f2py. I know it is possible, but is there is some
hidden issues that make this difficult.
thanks,
mark



More information about the f2py-users mailing list