[Beowulf] C vs C++ challenge

Keith D. Underwood kdunder at sandia.gov
Wed Jan 28 15:35:49 EST 2004

> And once again C++ fills the expectation here, IMO. Paraphrasing you: "This 
> works just marvey... with C++ exactly because any... entity they need to sort 
> and the sort criterion can be fed to the subroutine successfully and the 
> subroutine will happily work with". This, of course, thanks to C++'s 
> templates. And the result is even highly readable and quite compact usually 
> (and this is the reason I am ready to cope with performance penalties, 
> because I can put out code 10-20 times faster than in C -- OK, this is a 
> subjective measure -- and that code will only run 2-3 times slower -- citing 
> another poster "that's what clusters are for" ;-).

So, in some very real examples, the performance difference between an
existing Fortran code and the first version of a C++ code was more like
a factor of 10.  When you look at the impact of that in real dollars on,
say, an ASCI scale computing platform that costs $90+ million, it is
huge.  If that code is used for very long, you are wasting 90% of the
machine or $80+ million (and we won't count the very significant cost of
electricity or cooling for a machine of that scale).   So, then the
programmers get to spend their days trying to get some of that
performance back.  

In one example, a Fortran code was being replaced by a C++ code.  The
C++ code was way too slow and the core computational routines were
replaced with their Fortran equivalent.  The code was still a factor of
2 to 3 behind.  By the end of it, a lot more effort had been spent on
trying to make the C++ code run fast than was spent when the C++ code
was scrapped and the Fortran code was updated instead.  

Ease of programming is good, but the performance implications cannot be
ignored.  Even a factor of 2 is a lot of money when you talk about a
large computing resource.  Even a large computing resources as
inexpensive as the Virginia Tech Mac cluster.


Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf

More information about the Beowulf mailing list