* Numerical simulations on alphalinux: C or fortran?
@ 1999-03-04 11:05 Lorenzo Bernardi
1999-03-04 11:30 ` Andrei A. Dergatchev
1999-03-04 13:00 ` Jochen Kuepper
0 siblings, 2 replies; 6+ messages in thread
From: Lorenzo Bernardi @ 1999-03-04 11:05 UTC (permalink / raw)
To: axp-list
Dear all,
I bought a alphalinux workstation to make numerical simulations. The
kind of numerical simulation I'm doing is monte carlo and it evolves
mainly calculating EXP and COS with real*8. The language I use is
fortran77. For now on the alphalinux I compile on a DU workstation and use
the compiled binaries.
My question is will I gain in term of speed to transfer my code from
fortran to C? I will then use egcc compiler plus the new libcpml.
It seems that C compiler are evolving faster thna fortran compiler and
thus they can be better for fp operation than fortran compiler. Or maybe
the enhancement are different.
Any experience with simulation on alpha machine is greatly appreciated.
(Other compiler brand or optimization tricks and so on)
And another question is related to top. Essentially the time is wrong and
I'm using
CPU states: 797.0% user, 0.3% system, 99.9% nice, 0.0% idle
~~~~~
which is quite difficult with only one CPU. I have the same problem with
the time command.
Thamks in advance,
Lorenzo Bernardi
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Numerical simulations on alphalinux: C or fortran?
1999-03-04 11:05 Numerical simulations on alphalinux: C or fortran? Lorenzo Bernardi
@ 1999-03-04 11:30 ` Andrei A. Dergatchev
1999-03-04 18:55 ` Chris Albertson
1999-03-04 13:00 ` Jochen Kuepper
1 sibling, 1 reply; 6+ messages in thread
From: Andrei A. Dergatchev @ 1999-03-04 11:30 UTC (permalink / raw)
To: axp-list
Hi,
> Dear all,
>
> I bought a alphalinux workstation to make numerical simulations.
So did I :-)
[snip]
> My question is will I gain in term of speed to transfer my code from
> fortran to C?
0) Depends on your code :-)
1) I've been dealing with large FEM calculations and what I miss a lot
comparing to Wintel side is a tranparent debugger. Absence of
dynamic allocation is a considerable minus for f77 vs C comparison
if your application is a memory hog. But using g77/gdb combo it
really gets more debugging time than what I'd prefer :-((
I'd really surprised if rewriting the same from f77 to C you'll gain more
then few % in time, but I haven't had any experience yet.
[snip]
>
> Thamks in advance,
>
> Lorenzo Bernardi
Regards,
Andrei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Numerical simulations on alphalinux: C or fortran?
1999-03-04 11:30 ` Andrei A. Dergatchev
@ 1999-03-04 18:55 ` Chris Albertson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Albertson @ 1999-03-04 18:55 UTC (permalink / raw)
To: axp-list
Andrei A. Dergatchev wrote:
>
> Hi,
>
> > Dear all,
> >
> > I bought a alphalinux workstation to make numerical simulations.
>
> So did I :-)
> [snip]
>
> > My question is will I gain in term of speed to transfer my code from
> > fortran to C?
If you use the GNU compilers the "back end" the part of the compiler
that generates the code is the same for C and FORTRAN. I built eggs
1.1.1 from source on my ALpha and included the F77 front end in my build.
>
> 0) Depends on your code :-)
>
> 1) I've been dealing with large FEM calculations and what I miss a lot
> comparing to Wintel side is a tranparent debugger. Absence of
> dynamic allocation is a considerable minus for f77 vs C comparison
> if your application is a memory hog. But using g77/gdb combo it
> really gets more debugging time than what I'd prefer :-((
Get "ddd". It is the kind of debugger you say you miss. It is
the typical "visual" type thing where you can move a highlight
bar one line at a time through the source code while watching
variables in display windows. Yes, it does build cleanly on Alpha
Linux.
>
> I'd really surprised if rewriting the same from f77 to C you'll gain more
> then few % in time, but I haven't had any experience yet.
Pior to GNU F77 becomming stable I used f2c. This is a quite robust
FORTRAN to C translator. It comes with a script that hides the translation
phase. Makes you think you are running a real F77 compiler. One could
use f2c and your current copy of eggs. Worked for me on about 100,000
lines of FORTRAN.
>
> [snip]
>
> >
> > Thamks in advance,
> >
> > Lorenzo Bernardi
>
> Regards,
>
> Andrei
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
--
--Chris Albertson
chris@topdog.logicon.com Voice: 626-351-0089 X127
Logicon RDA, Pasadena California Fax: 626-351-0699
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Numerical simulations on alphalinux: C or fortran?
1999-03-04 11:05 Numerical simulations on alphalinux: C or fortran? Lorenzo Bernardi
1999-03-04 11:30 ` Andrei A. Dergatchev
@ 1999-03-04 13:00 ` Jochen Kuepper
1999-03-04 13:34 ` Helge Kreutzmann
1 sibling, 1 reply; 6+ messages in thread
From: Jochen Kuepper @ 1999-03-04 13:00 UTC (permalink / raw)
To: Lorenzo Bernardi, Lorenzo Bernardi, axp-list
On Don, 04 Mär 1999 Lorenzo Bernardi wrote:
> I bought a alphalinux workstation to make numerical simulations. The
>kind of numerical simulation I'm doing is monte carlo and it evolves
>mainly calculating EXP and COS with real*8. The language I use is
>fortran77. For now on the alphalinux I compile on a DU workstation and use
>the compiled binaries.
>
> My question is will I gain in term of speed to transfer my code from
>fortran to C? I will then use egcc compiler plus the new libcpml.
>It seems that C compiler are evolving faster thna fortran compiler and
>thus they can be better for fp operation than fortran compiler. Or maybe
>the enhancement are different.
>
>Any experience with simulation on alpha machine is greatly appreciated.
>(Other compiler brand or optimization tricks and so on)
Well, in my experience C looses against FORTRAN most of the time, but they are
close, usually. If you have some complex stuff, you can write nice and fast C++
programs, though, esp. if you use inline functions efficiently. Often these are
faster than corresponding FORTRAN, since nowadays people usually don't write
spaghetti code any more - even if they use FORTRAN77 :-)
But in the end, I would say, speed mostly depends on good algorithms and
efficient implemetations, not on the programming language.
Greetings,
Jochen
-----------------------------------------------------------------------
Jochen Küpper
Heinrich-Heine-Universität Düsseldorf jochen@uni-duesseldorf.de
Institut für Physikalische Chemie I
Universitätsstr. 1, Geb 26.43 Raum 02.29 phone ++49-211-8113681
40225 Düsseldorf fax ++49-211-8115195
Germany http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Numerical simulations on alphalinux: C or fortran?
1999-03-04 13:00 ` Jochen Kuepper
@ 1999-03-04 13:34 ` Helge Kreutzmann
1999-03-04 18:54 ` Jochen Kuepper
0 siblings, 1 reply; 6+ messages in thread
From: Helge Kreutzmann @ 1999-03-04 13:34 UTC (permalink / raw)
To: axp-list
Hallo !
On Thu, 4 Mar 1999, Jochen Kuepper wrote:
>
> On Don, 04 Mär 1999 Lorenzo Bernardi wrote:
> >
<cut>
> > My question is will I gain in term of speed to transfer my code from
> >fortran to C? I will then use egcc compiler plus the new libcpml.
> >It seems that C compiler are evolving faster thna fortran compiler and
> >thus they can be better for fp operation than fortran compiler. Or maybe
> >the enhancement are different.
<cut>
> Well, in my experience C looses against FORTRAN most of the time, but they are
> close, usually. If you have some complex stuff, you can write nice and fast C++
> programs, though, esp. if you use inline functions efficiently. Often these are
> faster than corresponding FORTRAN, since nowadays people usually don't write
> spaghetti code any more - even if they use FORTRAN77 :-)
>
> But in the end, I would say, speed mostly depends on good algorithms and
> efficient implemetations, not on the programming language.
There is an interesting comparison done by the University of Cambridge
regarding the possibilities to optimes fortran vs. C code. You can read it
under
http://www.hpcf.cam.ac.uk/C_rant.html
It suggests that FORTRAN code can be optimized more easily thus (at least
in theory) providing faster code.
Helge
-- 533 Mhz -- 533 Mhz -- 533 Mhz -- 533 Mhz -- 533 Mhz -- 533 Mhz -- 533 Mhz --
Is your penguin 64 bit ? --> http://www.stud.uni-hannover.de/~helgek
Helge.Kreutzmann@stud.uni-hannover.de
kreutzm@itp.uni-hannover.de
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Numerical simulations on alphalinux: C or fortran?
1999-03-04 13:34 ` Helge Kreutzmann
@ 1999-03-04 18:54 ` Jochen Kuepper
0 siblings, 0 replies; 6+ messages in thread
From: Jochen Kuepper @ 1999-03-04 18:54 UTC (permalink / raw)
To: axp-list, Helge Kreutzmann
On Don, 04 Mär 1999 Helge Kreutzmann wrote:
>On Thu, 4 Mar 1999, Jochen Kuepper wrote:
>> But in the end, I would say, speed mostly depends on good algorithms and
>> efficient implemetations, not on the programming language.
>
>There is an interesting comparison done by the University of Cambridge
>regarding the possibilities to optimes fortran vs. C code. You can read it
>under
>
>http://www.hpcf.cam.ac.uk/C_rant.html
>
>It suggests that FORTRAN code can be optimized more easily thus (at least
>in theory) providing faster code.
Yeah, short but nice page. I would still kep my claim, though, based on my
(special ?) personal experiences.
Looking at the programs around me, there usually really is not much of a
difference between programs that are plain FORTRAN or completly C, but the
amount of thought/work people put into their code counts much more.
Btw: My main programming project is a mixed FORTRAN / C++ project, and thats
the way I would suggest for anybody seriously beeing concerned about speed.
Then there remains the problem of which parts to write using this or that
language. You also can use all these nice FORTRAN libs from within C++ classes,
so you can manipulate your class easily from C++, but it does FORTTRAN in
reality :-)
Here this seems to save development efforts by writing ugly FORTRAN and saves
runtime by using nice programs.
But then an good assembler BLAS is even better :-)
Greetings,
Jochen
-----------------------------------------------------------------------
Jochen Küpper
Heinrich-Heine-Universität Düsseldorf jochen@uni-duesseldorf.de
Institut für Physikalische Chemie I
Universitätsstr. 1, Geb 26.43 Raum 02.29 phone ++49-211-8113681
40225 Düsseldorf fax ++49-211-8115195
Germany http://www-public.rz.uni-duesseldorf.de/~jochen
-----------------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1999-03-04 18:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-04 11:05 Numerical simulations on alphalinux: C or fortran? Lorenzo Bernardi
1999-03-04 11:30 ` Andrei A. Dergatchev
1999-03-04 18:55 ` Chris Albertson
1999-03-04 13:00 ` Jochen Kuepper
1999-03-04 13:34 ` Helge Kreutzmann
1999-03-04 18:54 ` Jochen Kuepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox