Re: Choice of programming language
- From: "Michael Hennebry" <hennebry@xxxxxxxxxxxxxxxxxxxxx>
- Date: 15 Mar 2006 17:09:03 -0800
Mark B wrote:
I was wondering what the programming language of preference currently
is for numerical integration work. Particularly for long time length
integrations such as in solar system dynamics where you might be
expected to integrate over perhaps 10^9 time steps and consume
considerable cpu time.
In the past it seemed that Fortran was the preferd language but was
wondering whether C++ or even Java would seriously be considered, and
if not, why not.
There is an important difference between FORTRAN and C/C++ semantics.
FORTRAN requires that a function not be secretly
handed the same variable under two different names.
An exception is allowed if it doesn't matter.
I think that some C/C++ compilers have pragmas or
other extensions that effectively make the same promise.
It allows optimizations that would not otherwise be safe.
That said, C/C++ allows at least one optimization that is difficult
to do in FORTRAN: aggregating data of different types.
Parallel arrays could double your cache
misses and require an extra register.
This could have changed. It's been a while since I used FORTRAN.
Whether it has or not,
tuning one's code to avoid cache misses can be interesting.
Whether java is sllooowwwww for real or just
by dogma probably depends on at least a couple things:
whether one has compiled to native code and
the kind of data structures one uses.
In java, an array of primitive types is an array of primitive types,
but an array of classes is an array of references.
In addition to adding a layer of indirection,
it raises locality (cache miss) issues.
In any case, if one is integrating over a billion iterations,
it's probably a good idea to pay attention to the numerical analysis.
.
- Follow-Ups:
- Re: Choice of programming language
- From: Dan Nagle
- Re: Choice of programming language
- References:
- Choice of programming language
- From: Mark B
- Choice of programming language
- Prev by Date: Re: DelaunayTriangulation and Quadrangulation
- Next by Date: Re: Choice of programming language
- Previous by thread: Re: Choice of programming language
- Next by thread: Re: Choice of programming language
- Index(es):
Relevant Pages
|
Loading