NetSolve, a grid based problem solver, allows users to remotely access
computational resources. Several interfaces exist allowing access to NetSolve resources.
These interfaces include access from Fortran, C, Matlab, and Mathematica. Notably, however,
there is no interface for .NET users. Given the promise of the .NET architecture, many NetSolve
users desire to port their code to it. The .NET C# interface for NetSolve is developed to
facilitate this process.
Many approaches were considered in trying to find a solution. The first approach we
considered dealt with the question of creating a managed API, because most of .NET's
promise relies on the usage of managed code. The second approach we considered
involved creating an unmanaged API and then creating a C# interface for it.
This approach involved more steps then creating a managed API.
As we considered creating a managed API it seemed very promising. Porting the C API to C#
gave us all the benefits of a managed code interface to NetSolve and didn't appear to be
much more work. However, the appearances were deceiving and two main problems
began to appear. First, when looking at the amount of work involved in porting the
C API to C#, the task became unproductive under the current time constraints. Second, the issue of
code maintenance appeared to be a burden. As we considered these
problems, the problems quickly began to outweigh the problems forcing us to try the unmanaged
approach. While not as easy to use, creating a managed interface to an unmanaged dll quickly
became the better approach and eventually the one that we implemented. Figure 1 shows the
structure of the interface. A managed class CSNetSolve.dll is built to call unmanaged NetSolve.dll.
The unmanaged class takes care of all the interaction with NetSolve system.