Re: question about efficiency of fortran in parallel environments



Dan Nagle wrote:
Hello,

On Fri, 27 May 2005 10:24:05 -0700, Randall Mackie
<rlmackie862@xxxxxxxxx> wrote:

<snip>

One of the programmers in my company, who programs mainly in c,
has said that my program could be made more efficient if it
were converted from Fortran to C. I'm not sure I'm convinced
of this at all, but I was hoping for some feedback from people
who program in both Fortran and C, especially in parallel environments.


MPI is written in C, so there's an extra layer of call executed
for each MPI call.  But that's one call/return per call.

An MPI procedure execution usually involves a switch to the OS
to start a communication (on both processes), then communicating
between processes.  On a cluster, this means establishing
the logical connection between two processors.

Compared to which the extra call and return are very small.
Note that the extra call and return also apply to the C++ binding
as well.


Other people (the PETSc programmers) have said it doesn't make any difference whether I use
C or Fortran. But, we have to make a decision, and I'm afraid I
don't know the correct answer as I seem to be getting conflicting
advice. Any help would be appreciated.


Trying to learn a new programming language to save a clock cycle
here and there is unlikely to succeed.

As soon as you have an f03 compiler, you could call the C binding
directly from Fortran, and shave those few cycles as well.

Can't most compilers already call the C binding directly? So there shoulnd't be any overhead at all.


Thanks in advance.

Randy Mackie




--

Gary Scott
mailto:garyscott@xxxxxxx

Fortran Library:  http://www.fortranlib.com

Support the Original G95 Project:  http://www.g95.org
-OR-
Support the GNU GFortran Project:  http://gcc.gnu.org/fortran/index.html

Why are there two?  God only knows.


If you want to do the impossible, don't hire an expert because he knows it can't be done.


-- Henry Ford
.



Relevant Pages

  • Re: X11 libraries for FORTRAN on OSX or Linux?
    ... binding for fortran on linux or osx.. ... > require a deeper understanding of how VMS Fortran bindings work. ...
    (comp.lang.fortran)
  • Re: http or tcp/ip
    ... good place for a F2k3 compiler to put them would be as extensions to the ... F2003 the name decoration can already be handled by specifying a different ... A better solution than identifying different binding types (ie ... What I want to do is to be able to use Fortran to produce libraries compatible with the assumptions made by other languages. ...
    (comp.lang.fortran)
  • Re: Interested about number crunching in Ada
    ... The above binding is written for Ada 95. ... pragma Convention (Fortran, Vector); ...
    (comp.lang.ada)
  • Re: Calling Fortran from Java on Windows
    ... You can't directly call Fortran routines from JAVA. ... Fortran also provides C binding. ... binding as a pass through to Fortran (in both directions). ...
    (comp.lang.fortran)