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

C# vs Fortran

jlgilber
Beginner
2,352 Views
It appears that my company is considering converting some of our FORTRAN applications to a newer language.
Does anyone have any experience in converting to C#?
How does C# compare in execution times to FORTRAN?
0 Kudos
6 Replies
TimP
Honored Contributor III
2,352 Views
You might compare 32-bit C# running on Windows with one of the 32-bit Fortran compilers with a CLR code generation option. CLR code is run by an interpreter or "just-in-time" compiler, so the performance depends on the run-time system as much as it does on the compiler. In principle, performance of CLR code generated by a Fortran translator need not be different from the result of a C# translator. Intel Fortran doesn't have the option to generate CLR; it generates "unmanaged" native code which can be linked into the CLR framework. Information on that has been posted on this forum. Fortran compilers with ability to generate CLR code also have 32-bit native code generation options. Performance potential of Fortran native code is much higher than CLR code; how much so is extremely dependent on context. Recent development has focused on the 64-bit operating systems, and I haven't seen CLR Fortran for those systems.
Excuse me for weighing in on this issue, but it appears to be far enough from the mainstream that other have had difficulty finding a response.
0 Kudos
Les_Neilson
Valued Contributor II
2,352 Views

There should be compelling reasons for changing from one language to another. The company I now work for had also considered converting but only because of the difficulty in finding staff with Fortran experience. Performance wise :with modern compilers and hardware in real world applications (I'm in 3D CAD for example, and I have previous experience in Geological modelling, surveying, engineering, andhydrogeology systems; all mixed language C/Fortran)there will probably be little or no difference to the end user. Personally I find Fortran's maths, especially the array processing, easier to use. Other peoplewith more experience in different languages will prefer their own "familiarity". YMMV as they say.

If the argument for change is merely"to use a more modern language" then it is likely a false argument - Fortran95 and the coming Fortran2003 are modern languages and will, generally speaking, compile with little or no problem old Fortran code. Problem areas would be in portability,code that used hardware specific facilities or compiler specific extensions.

HTH
Les
0 Kudos
onkelhotte
New Contributor II
2,352 Views
My department is at a similar point to make the decision to use Fortran or change the language (maybe into C#).
We use CVF 6.6c and we tried to move our projects to IVF8.1 one year ago, but we had significant problems. I dont know how easy that would be with IVF9, we dont have time to try that again at the moment.
2 of our 4 engineers will go into retirement and it is hard to find people with fortran experience.
So if the calculations wont take significant longer in C# than in Fortran I would prefer a more modern language so we could use software modelling tools like Rational Rose to build our code. We would start our new projects with C# and continue or old ones with CVF...
0 Kudos
Les_Neilson
Valued Contributor II
2,352 Views
We recently upgraded from CVF to IVF9we alsoupgradedVisual Studio 6 to .NET 2003 and I was given the job of pioneering the change. The Fortran code changes were minor(and much of the code has its origins in the early1980's). The C++ changes were considerable! Mostly because of the changes in the stream header files, namespaces and such like.
I have no real experience of C# - though a couple of our projects (developed in another office)are C#. So I cannot comment definitively on speed differences - note my original reply used caveats "probably", "likely". I guess the proper answer is "it depends".
BTW In order to convert fromone languageto another will require some learning of the first language in order to understand what is going on, may as well learn the language in the first place, and Fortran is not that hard to pick up. After all it was originally designed to be used by users not computer experts and I've been using it for about 30 years :-)
Les
PS Fortran is a modern language, being regularly updated and developed.
0 Kudos
onkelhotte
New Contributor II
2,352 Views

It would be nice if you contact me vie email (just view my profile) sowe could talk about this topic a little bit more.

Markus

0 Kudos
Les_Neilson
Valued Contributor II
2,352 Views

Markus,

When I view your profile I do not see an email address.

You can contact me at

l dot neilson at acecad dot co dot uk

Les

0 Kudos
Reply