Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Program Structure?

khjavaid1
Beginner
523 Views
I am calling a Fortran dll from C#.
The dll is called from a single function call in C# (dllimport ...)
The dll produces data, which I want to access in real-time as and when it is generated in C#. However, the single function call will obviously only return the final answer.
How can I setup either the dll or the C# to give me data as I require? Do I need to make an additional function call in C# that gives me access to the dataor will the dll have to setup to send data back periodically? If so, how can I do this?
Your help is appreciated.
0 Kudos
1 Reply
Intel_C_Intel
Employee
523 Views
A somewhat novel approach you may wish to consider is to use Array Visualizer. AV can be used to handle hierarchal data collections and has bindings for both C# and Fortran. One advantage for your application is that you wouldn't need to pass the data from Fortran to C# (or vice-versa).Instead you would have the Fortran dll create a named data object ("foo" lets say). The C# code can then open "foo" and access the data.
An additional benefit of using AV to manage your data is that you can save the data hierarchy to a file (XML or HDF5) with one call. The file can be viewed with the Array Viewer program.
You could even have the Fortran code running on a separate thread (or even process) and have the C# code examine the data while the Fortran code is running in the background.
Anyway, if you are interested in this approach please post something on the Array Visualizer forum. It shouldn't be too hard to come up withC#/Fortran example program.
0 Kudos
Reply