Dear FreeFem++ developers,
thanks first of all for the great work.
I am interested in coupling a (large) Fortran code with a FreeFem++ application. I have been considering several options. As mentioned in the topic title, option 3) is the one I would like to draw your attention to:
Data exchange by writing on files (rough, slow and unstable but it requires very little modification to both the Fortran code and the FreeFem++ application) - this is the one I have currently implemented. Nevertheless, loss of synchronization between the two codes and data loss are frequent, so I am not satisfied;
Coupling of the two codes by means of an external coupling framework (I have been considering OpenPALM [https://www.cerfacs.fr/globc/PALM_WEB/]). This is probably the most flexible and robust way, but it is not completely straightforward to implement, and after many attempts I gave up -I am still considering the option of contacting the cerfacs developing team, though…- ;
Using the mmap/semaphore feature you mention at paragraph 3.7.3 of the manual. This would be very stable and immediately applicable.
The issue with point 3) is that the current version of the library is written in C. It would be great if you could provide a Fortran equivalent for libff-mmap-semaphore.c and libff-mmap-semaphore.h. Do you think it would be possible to do that?
Dear prof. Hecht,
thanks a lot for the very prompt reply and for your explanation.
Indeed, once compiled, the functions contained in the library libff-mmap-semaphore.c (thus becoming libff-mmap-semaphore.o) can be easily called from a FORTRAN code such as the one you have kindly provided. It is sufficient to dynamically link the library when compiling the FORTRAN code.