Re: speed up calculation suggestions
- From: Chip Coldwell <coldwell@xxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Nov 2007 08:52:25 -0500
On Tue, 13 Nov 2007, rleavitt@xxxxxxxxxxxxxxxx wrote:
I am an actuary and not a system professional and so please bear with
me. We use Fortran for some or our calculations and are being hampered
by long calculation times. There is nothing fancy in the code... I
process many millions of records from text files through some fairly
simple calculations, and write out the results. I want to speed up
this process, but am really not sure where to devote my efforts. I
have a new (dual core) windows XP machine with F95 compiled by
absoft. (I think version 7.5). I do not have much system support and
not too much time for experimentation, but am willing to tinker a
little. I am interested in other's thoughts.
Options:
1. Optimize my code: I am not sure what this means... It is pretty
stripped down now.
2 Get an updated compiler (any suggestions?)
3 Switch to Linux
4. Vectorize my code and use multiple processors (not sure how hard
this is).
5. Upgrade my computer (are some CPU's better at computation than
others?)
6. Other suggestions?
Of course, I do several of things, but really want help deciding what
will give me the biggest improvement for the least effort.
Absolutely, positively the first thing to do is to profile your code.
You may think you know where the time is going, but you don't really
know until you profile it. The GNU compilers come with gprof for this
purpose, Intel offers VTune(TM), other vendors have other names for
their profilers. Profiling identifies where you should concentrate your
efforts.
"Optimize" should be interpreted to mean enabling the compiler to
optimize. I saw a suggestion go by that you enable inter-module
optimizations, such as function inlining to avoid function-call
overhead. That's a good example of this sort of thing. There might
also be compiler directives/command line options to encourage the
compiler to vectorize certain critical inner loops. That's another
good example.
Switching to Linux probably won't make a heckuvalot of difference.
Using multiple processors could be a big win, depending on the
algorithm. For example, monte-carlo simulations usually see a linear
speedup (N processors run the code N times faster). That could be a
big project, though, depending on the code and algorithms.
A faster CPU will run the code faster unless it is I/O bound.
Chip
--
Charles M. Coldwell
"Turn on, log in, tune out"
Somerville, Massachusetts, New England
.
- References:
- speed up calculation suggestions
- From: rleavitt
- speed up calculation suggestions
- Prev by Date: Re: Challenge: reading ascii data
- Next by Date: Re: Challenge: reading ascii data
- Previous by thread: Re: speed up calculation suggestions
- Next by thread: Re: speed up calculation suggestions
- Index(es):
Relevant Pages
|