C function vs Fortran function performance

Steve Nuchia
Total Points:
2,237
Status Points:
1,737
Brown Belt
November 25, 2008 10:12 AM PST
Rate
 
|Best Answer
#3

The main differences are

one compiler may simply be better, or better adapted to your particular situation, than the other.

the fortran library is likely to be better tuned for many mathematical operations -- but you can call it from C if you want.

the fortran language permits the compiler to make certain optimizations that are seldom possible in standard C / C++, mainly due to potential aliasing but also to potential recursion / reentrancy issues.  It is usually possible to provide "hints" to a performance-oriented C / C++ compiler that will allow it to make the same optimizations.

In the end, in my opinion, it is easier to express and understand algorithms that involve more advanced data structures in C / C++ than in the fortran that I learned.  Modern fortran may be better but it still feels very combersome to me.  Since better algorithms beat better code every time, use the language that admits the most natural  and most maintainable expression of the algorithm.



Intel Software Network Forums Statistics

8473 users have contributed to 31605 threads and 100654 posts to date.
In the past 24 hours, we have 30 new thread(s) 110 new posts(s), and 160 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member Kevin Johnson