Hello all,
I'm working on a number of scientific number-crunching problems where it's quite important that I squeeze a high degree of performance out of my code. I originally learnt to program in C and in general this has been sufficient for my needs---but I haven't needed to really, really stretch performance capabilities until recently.
Anyway, I'm interested in FORTRAN both because it's an interesting language in its own right (and used by quite a few scientific colleagues, so it would be useful to know exactly what their programs are doing), and because, at least historically, its numerical and mathematical aspects were superior to C. However, I've been told by some colleagues that the speed gap is pretty much non-existent these days.
So, the questions I'd like to ask are: first, what is the current situation regarding number-crunching differences between FORTRAN and C? I'm not making extensive use of mathematical functions (sin, cos, etc.) at the present; my code consists of having a few large arrays and needing to do fairly simple arithmetic between individual locations at a time. (So, no vector multiplication, for example; the typical thing is, "Check value of z, if it's greater than 4 set it to zero and add 1 to each of z[j], z[k], z[l] and z[m]".)
Second, what are the major issues I should be aware of when switching from C to FORTRAN? Superficially there appears to be much that is similar but I'd rather not rely on that assumption too heavily.... ;-)
Many thanks,
-- Joe
I'm working on a number of scientific number-crunching problems where it's quite important that I squeeze a high degree of performance out of my code. I originally learnt to program in C and in general this has been sufficient for my needs---but I haven't needed to really, really stretch performance capabilities until recently.
Anyway, I'm interested in FORTRAN both because it's an interesting language in its own right (and used by quite a few scientific colleagues, so it would be useful to know exactly what their programs are doing), and because, at least historically, its numerical and mathematical aspects were superior to C. However, I've been told by some colleagues that the speed gap is pretty much non-existent these days.
So, the questions I'd like to ask are: first, what is the current situation regarding number-crunching differences between FORTRAN and C? I'm not making extensive use of mathematical functions (sin, cos, etc.) at the present; my code consists of having a few large arrays and needing to do fairly simple arithmetic between individual locations at a time. (So, no vector multiplication, for example; the typical thing is, "Check value of z, if it's greater than 4 set it to zero and add 1 to each of z[j], z[k], z[l] and z[m]".)
Second, what are the major issues I should be aware of when switching from C to FORTRAN? Superficially there appears to be much that is similar but I'd rather not rely on that assumption too heavily.... ;-)
Many thanks,
-- Joe