C function vs Fortran function performance

shachris23
Total Points:
435
Status Points:
0
Green Belt
November 25, 2008 1:58 PM PST
Rate
 
#4 Reply to #3
Quoting - Steve Nuchia

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.

I agree with your assertion there. I believe the language that can best solve the given problem should be used.

By the way, let's say if someone use Fortran with C\C++ code, how does one go about debugging it? So if we called a Fortan code from C...how does one go about "stepping into" Fortran code if needed be?

My environment is Windows Visual Studio C++.

Thanks,

S.



Intel Software Network Forums Statistics

8474 users have contributed to 31606 threads and 100656 posts to date.
In the past 24 hours, we have 30 new thread(s) 109 new posts(s), and 163 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