Re: question about efficiency of fortran in parallel environments
- From: "Gary L. Scott" <garyscott@xxxxxxx>
- Date: Sat, 28 May 2005 16:09:52 -0500
Dan Nagle wrote:
Can't most compilers already call the C binding directly? So there shoulnd't be any overhead at all.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.
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 .
- References:
- question about efficiency of fortran in parallel environments
- From: Randall Mackie
- Re: question about efficiency of fortran in parallel environments
- From: Dan Nagle
- question about efficiency of fortran in parallel environments
- Prev by Date: Re: question about "call qsort"
- Next by Date: Re: My philosophy
- Previous by thread: Re: question about efficiency of fortran in parallel environments
- Next by thread: advance="no" not portable
- Index(es):
Relevant Pages
|
|