odevauchelle / pyFreeFem

Python wrapper library for FreeFem++
GNU General Public License v3.0
19 stars 4 forks source link

Shared memory between python and FreeFem++ #1

Closed hchauvet closed 4 years ago

hchauvet commented 4 years ago

Hi Olivier,

I just read this from the python side for shared memory on POSIX system (like linux) https://docs.python.org/3/library/mmap.html http://semanchuk.com/philip/posix_ipc/

And then i just remember that you want to interact with freefem++ without writing files, so I just check in the new FF++ docs for my curiosity and I found an interesting thing: https://doc.freefem.org/documentation/plugins.html#mmap-semaphore

So either it is possible to talks directly to the same mmap file from python and FF++, and it seems possible to write a kind of sharing language or it might be possible to create an intermediate c file and bind it to python using cython. https://cython.readthedocs.io/en/latest/

I did not test anything but it seems to be an interesting way to interact between Python and FF++ !

odevauchelle commented 4 years ago

Hi Hugo,

Thanks for your suggestion ! Mmap looks really nice. I'll try it.

Olivier.