Re: speed up calculation suggestions



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
.



Relevant Pages

  • Re: GAMESS on 64bit architecture
    ... The machine needs to be fairly cheap, so, ... > What type of compiler did you use? ... least 2 SATA disk drives and RAID-0 them, CC calculations are quite disk ... drives would not be overkill. ...
    (sci.chem)
  • Re: The result of 1 << 32
    ... > constant calculations are supposed to be done "as if" they were ... would it not be required to be consistant? ... then the compiler can do the same thing at compile-time. ... a shift at compile time when it is optimising. ...
    (comp.lang.c)
  • Re: sorting the input
    ... Ben Bacarisse said: ... The compiler does some calculations to determine the type and hence ... have licence to get it wrong. ...
    (comp.lang.c)
  • Re: I wasnt expected that !
    ... The compiler might even be as clever as to simply *not do* some of the ... calculations at all, since it knows the variables don't get used in a ... > versions of the software for occasional programming sessions. ... > means six general math operations per loop, which means about 540,000,000 ...
    (microsoft.public.dotnet.languages.vc)
  • Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
    ... I would really want to see some program in gcc package that takes source code and some profile results and tries to suggest some annotations for the code like ... It also should warn if it finds annotations already in the code that don't match profile results. ... Also it can make debuging strange problems (that can be caused by buggy compiler) much harder because everyone can have completly different binary code generated by their compiler because completly different profile was used. ...
    (Linux-Kernel)