How to share memory between c# and fortran; multiple processes

Viewed 31

I am trying to write a multi-language program with c# and fortran whose end goal is to have multiple cores editing different sections of an array. I was able to achieve this in a program using c++ and fortran by using file mapping. I was able to create file mappings that held various array data, and was able to pass pointers to them to the fortran side where the editing of the arrays was done. I was also able to get handles to these mappings and pass them to the higher cores (who then passed the pointers to fortran,etc.) so that all the processes were working in the same block of memory.

I am trying to replicate this process in c#. According to the research I've done, it seems like the c# equivalent of file mappings is using MemoryMappedFiles. However, when doing this it seems that the higher cores are not editing the same arrays as core 0. Not sure if this is due to c# being managed while fortran is unmanaged.

Is there a way to create a pointer to an array in c# that I can then pass to fortran to work on, which would also be accessible to higher core proccesses?

0 Answers
Related