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

Performance of IVF9.1 in VS2003 and VS2005

onkelhotte
New Contributor II
866 Views

Hi there,
my company wants to change from CVF to IVF at last :-)

But now there is a discussion, what IDE (VS2003 or VS2005) we will use and whether we will create mixed language projects with C# and IVF or not.

Are there any differences in performance when I programa fortran only project in VS2003 and VS2005?

Is it possible to link a Fortran DLL that was build with VS2003 in a C# project under VS2005? We want to use C# for GUI and output (DirectX/GDI and databases), but the math kernel should be in fortran.

Thanks in advance,
Markus

0 Kudos
9 Replies
jimdempseyatthecove
Honored Contributor III
866 Views

Markus,

While I am not a user of mixed language C# and IVF projects, I am a user of mixed language C++ and IVF (and assembler). I used to run on VS 2003 and was quite content with that up until I had the requirement to migrate my code to x64 platforms. Changing to VS2005 made the migration to x64 platforms (as well as compiling for both x32 and x64)a much easier task.

As for IVF DLL compiled with VS2003 for linkage with C# under VS2005 I think this would depend on most as to which, if any, runtime libraries the IVF DLL code used. If none, then you are in control over the interface and life should be easier. However, this being said, I believe a new attribute for external linkage has been defined (I am sorry I don't recall what it is at the moment), I would not know if on some environments that you may require this attribute. This is a new attribute used onWindows and which may be required (or beneficial) on Vista.

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
866 Views

I know of no performance difference for Fortran code between VS2003 and VS2005.

I see no reason why you could not use a VS2003-built Fortran DLL with C# in VS2005. Don't forget to enable "unmanaged code debugging" in the C# project (if you want to debug.) It would be easier to debug if both the C# and Fortran projects were in the same VS solution.

0 Kudos
Les_Neilson
Valued Contributor II
866 Views

I am at this moment involved in doing the VS2003 to VS2005 upgrade here. We too have mixed language projects Fortran with C or C++. There are some C# projects but they are stand alone.

If I may share my experiences so far. Things to watch out for :

The solutions(and projects)have to be "converted" but the conversion process doesn't always get it right. (At least not for me it didn't)Several of our solutions which build libraries had one or other of the projects marked as "exclude frombuild" This confused me for a while because the Fortran and C/C++ source filescompiled butit was when I came to link the lib with other code to make an exe I got unresolved errors. Also check that the dependencies have been correctly carried over. It was a long manual job.

Once I got the IVF integration correctly done there were no problems with the Fortran side of things. As always the C/C++ compiler changes mean errors in the source code.

For example

for (int i=0; i<9; i++) {

;

}

for (i=0; i<100; i++) {

;

}

the scope of "i" has changed it is only local to the first loop nd so "i" is undefined for the second loop. There is a compiler switch to accept the above code

Project|Properties|C/C++|Language| "Force Conformance In For Loop Scope" "No"

I changed all of our projects to set the above switch.

static iValue;has to be changed tostatic int iValue; (No default int anymore)

const iValue=42;has to be changed toconst int iValue=42;

POW and DIV arguments have to be of the same kind

POW(10, ...) had to be changed to POW(10.0, ...)

If you use strcat, strcpy etc then, like us, you willget *lots* of warnings about these being "unsafe" and should be changed to strcat_s, strcpy_s etc. one day someone will have to go though our code and make the changes (not a straight search and replace - different number of arguments).The warnings can be suppressed by the compiler option :

Project|Properties|C/C++|Advanced|Disable specific warnings 4996

I am currently struggling with some other problems which seem to be related to the values of WINVER and _WIN32_WINNT (which vary from 0x0400 to 0x0502 and anything in between throughout the VC directories.

Les

0 Kudos
Les_Neilson
Valued Contributor II
866 Views

Sorry, forgot to mention performance.

For those exe's I did get working (3D graphics display of steelstructures and 2D display of engineering drawings) there was no problem with performance.

Les

0 Kudos
onkelhotte
New Contributor II
866 Views

I see a reason why a VS2003 DLL wont work in VS2005: Its a Microsoft product and it should work :-)

Thanks for your replies. But its up to my boss to decide what solution we will use, C# only, IVF/C# mixed or IVF only.

By the way, is there a smart solution to transfer data between C# and IVF? Is it possible to create something like "COMMON" that can be accessed from C# or do I have to write for every variable a seperate Get/Set function in IVF?

Thanks in advance,
Markus

0 Kudos
Steven_L_Intel1
Employee
866 Views
C# (managed code) can't, as far as I know, share data structures with unmanaged code. Get/Put routines are a good design.
0 Kudos
onkelhotte
New Contributor II
866 Views

I ported two of our QuickWin Apps from CVF6.6 to IVF9.1 and they are both 10%-15% slower than before. Is that normal? In project settings everything is set to maximize speed.

Markus

0 Kudos
Steven_L_Intel1
Employee
866 Views

With QuickWin, how are you measuring speed? I know that in the later days of CVF we made some changes to QuickWin for correctness that had the side effect of slowing down the display of many lines of output.

0 Kudos
onkelhotte
New Contributor II
866 Views

Iveplaced a call cpu_time(begin) and call cpu_time(end) in my program. The difference is the calculation time.

But when I measured the time I didthis without any graphical output, only a dialog and text output.

I did not measure the speed of the diagrams.

Markus

0 Kudos
Reply