From: ttk@for_mail_remove_this_and_fruit.larva.apple.shinma.org (TTK Ciar)
Subject: Optimizing development code
Date: 1999/12/30 [thread overview]
Message-ID: <84eg9s$c1k$1@sparky.wolfe.net> (raw)
In-Reply-To: 386A809C.6CEB88A4@austin.rr.com
In article <386A809C.6CEB88A4@austin.rr.com>, John <john@mccalpin.com> wrote:
>
>
>Robert Groover wrote:
>>
>> One point I wonder about is development of new modelling tools?
>>
>> Suppose I want to do a new algorithm or a new application -
>> for a given cost per flop, isn't it much easier to run prototype software
>> on a machine which lets the user postpone the problems of optimal
>> parallellizing?
>> If so, then the availability of fast apparently-single-threaded machines
>> will always a have a role to play in supporting software R&D.
>
>It is certainly friendlier to develop prototype software on the fastest
>uniprocessor possible, because of the data dependence in the edit-compile-
>test-debug chain. In interviews a few years ago, most of the people
>still using the Cray vector machines at the national supercomputing centers
>named this as a key reason for their continued use of those systems. My
>contacts at certain spooky agencies have said the same thing.
>
>Parallelization is very often a waste of time, so it is not
>unreasonable to delay it until it you get to the point of having
>a production code with lots of demand for computation.
I agree to a point, but I'm more bullish about parallelization than
that. Dual-processor PC systems are fairly inexpensive and getting
cheaper all the time. Many corporations have multi-processor Solaris
systems to run applications on. If performance is an issue and you
think it at all likely that your code might have the chance to run on
a multiprocessor box, it is usually a good idea to write it as a
multithreaded application to begin with. It can be quite difficult to
add effective multithreading after the fact.
For some applications I take the idea one step further and write them
as multiple processes. This makes the application trivially able to be
distributed across multiple systems on a network without needing to be
rewritten.
If an application isn't worth writing coarse-grained parallism into,
though, then it's not worth optimizing it for high ILP either. C code
tends to generate lots and lots of unnecessary memory accesses, so
worrying about multi-issue while writing C is a complete waste of time.
Optimizing the inner loop of an algorithm by rewriting it in assembly
code is *usually* a waste of time, but can make sense in some contexts;
if it will be running on a specific generation of a specific processor
for a long time, then it may be worthwhile, but if you have the freedom
to recompile your application every time a new generation of processor
rolls out then you're better off sticking with C. An algorithm written
in assembly, optimized for an i486 will run faster on an i486 than C
code compiled by a compiler which optimizes for an i486, but that same
i486-optimized assembly code will generally run much more slowly on an
i686 than the equivalent C code compiled by a compiler which optimizes
for the i686.
And of course, *developing* a new algorithm in assembly is completely
insane. The design of an algorithm should always focus on code clarity.
The first practical implementation of that algorithm should begin only
after the design is complete, and it is then that you can start thinking
about optimizations. The design code can also be used to measure the
correctness of the optimized code.
-- TTK
next prev parent reply other threads:[~1999-12-30 5:00 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-20 5:00 Another SKC, plus a book review, posted on the Acersoft site Terry C. Shannon
1999-12-20 5:00 ` Larry Kilgallen
1999-12-21 5:00 ` John D. McCalpin, Ph.D.
1999-12-21 5:00 ` Paul DeMone
1999-12-22 5:00 ` John D. McCalpin, Ph.D.
1999-12-26 5:00 ` Robert Harley
1999-12-27 5:00 ` Doug Siebert
1999-12-27 5:00 ` David A Froble
1999-12-28 5:00 ` John
1999-12-28 5:00 ` David A Froble
1999-12-28 5:00 ` John
1999-12-30 5:00 ` Andy Glew
1999-12-31 5:00 ` Bob Kaplow
1999-12-31 5:00 ` John
2000-01-12 5:00 ` Eugene Miya
2000-01-12 5:00 ` Eugene Miya
1999-12-29 5:00 ` Jan Vorbrueggen
1999-12-29 5:00 ` MM5 (was Re: Another SKC...) Carlie Coats
1999-12-28 5:00 ` Another SKC, plus a book review, posted on the Acersoft site Jan Vorbrueggen
1999-12-28 5:00 ` David A Froble
1999-12-29 5:00 ` Jan Vorbrueggen
1999-12-29 5:00 ` chrisv
1999-12-30 5:00 ` Zalman Stern
2000-01-12 5:00 ` Eugene Miya
1999-12-27 5:00 ` Mark
1999-12-28 5:00 ` Jan Vorbrueggen
1999-12-28 5:00 ` Kai Harrekilde-Petersen
1999-12-28 5:00 ` Jeffrey S. Dutky
1999-12-28 5:00 ` Kai Harrekilde-Petersen
1999-12-29 5:00 ` Bob Kaplow
1999-12-29 5:00 ` Andrew Harrison SUNUK Consultancy
1999-12-29 5:00 ` Chris
1999-12-29 5:00 ` Chris
1999-12-29 5:00 ` Robert Groover
1999-12-29 5:00 ` John
1999-12-30 5:00 ` Agtabby
1999-12-30 5:00 ` TTK Ciar [this message]
2000-01-01 5:00 ` Russell Wallace
1999-12-21 5:00 ` Larry Kilgallen
1999-12-21 5:00 ` Terry C. Shannon
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox