[Beowulf] Teaching Scientific Computation (looking for the perfect text)
Vincent Diepeveen
diep at xs4all.nl
Tue Nov 20 12:46:41 PST 2007
There is several ways to look at this issue.
Suppose your students totally fail as physics student and even more
as future manager/teamleader and continue as computer science students.
Then what language can they use best?
If you open a job site, you'll find biggest companies interested in a
few languages: C++, JAVA, C#
You'll find near to zero C jobs and even less Fortran.
We can shredder JAVA and C# directly as those 2 languages you can
never make a program in that's less than 3 times slower than the C/C+
+ alternative.
C++ course is indeed hard to find, especially c++ courses where you
avoid 1000 things of c++ that make a program slow.
The amount of programmers on the planet who know how to write for
speed in C++ AND who are knowledgeable in C++,
like book writing level, you probably can list at 2 pages of A4.
Object orientatien is of course the opposite of what we want in a
speedy program. The idea of object orientation is to put everything,
both code and data in an object.
Small fundamental problem of that, is that allocating and
deallocating objects is getting done more or less automatic and
happens to be one of the slowest operations on the processor, let's
not even discuss the weakness of m$ which is memory defragmentation,
especially shared memory - you never know where those DLL's were loaded.
So C is a good start in that sense.
A good C programmer at least with some help can find his way in C++
code, Fortran really is outdated by now. It has 0 usage outside of a
few old programs that run on supercomputers and where teams of old
grey professors try to force manufacturers to keep their libraries
working for. It's that those machines are so expensive,
otherwise no fortran libraries would exist anymore at modern hardware.
Yet you ought to learn them C++ rather than C.
Just avoid them coding using sophisticated things of C++ which kill
speed.
Many companies will give you a big kiss if you learn them that, as
that avoids them a lot of trouble.
Now of course your hard job is then to figure out what is bad for
speed in C++ and to find a good C++ course which is basically more
like a C course,
than a C++ course.
Vincent
On Nov 20, 2007, at 7:33 PM, Nathan Moore wrote:
> I regularly teach a college course in a physics department that
> deals with scientific computation. After students take the course,
> I expect that they'll be able to write simple "c-tran" style
> programs for data analysis, write basic MD or MC simulations, and
> be fairly fluent in Mathematica.
>
> In the past, I figured that with the breadth of topics included in
> the course, Fortran, specifically the basic, simple, and reliable
> F77 dialect (w/ some F90 conveniences) was the language to teach.
> In my own head, my rationale was:
> - Most students can grasp the basics of fortran in half a day's
> reading, so I can spend more class time on science and math
> (probably because there are no pointers - I think that C is much
> harder for students and sometimes "seems" less like mathematical
> syntax than f77)
> - "Classical Fortran" is a great text and is readable for self-
> study (I know of no such text for C/C++)
> - several free compilers exist (g95 seems ok so far)
> - Netlib, lapack, and numerical recipes cover the math library
> adequately
> - F77 is compiled (Perl/python are too slow for an MD/MC sim and I
> figure that students should know at least on compiled language and
> one scripting language to be competent)
> - MPI is a relatively basic addition to the language (again, no
> pointers, allocation, or addressing)
>
> After reflection though, I've started to wonder about the wisdom of
> my choice. Specifically (like RGB), I love the GSL library, and
> extending GSL to fortran in an intro class is non-trivial.
> Additionally, most vendors supply "fast" hardware libraries in C (I
> may be ignorant, but if a student wants to call an AMD ACML fast-
> math function( http://developer.amd.com/acml.jsp), or write a
> linear algebra function to run on a graphics card(http://
> developer.nvidia.com/object/cuda.html ), the vendors seem to assume
> that you'll write the code in C).
>
> Also, and more relevant, I assume that most employers word-
> associate "Fortran is to backwards as C is to competence".
>
> So, I'm thinking about reworking the class to favor C, and fearing
> 3 weeks of pointer and addressing hell. For those of you who teach
> scientific computation (and also those of you who hire undergrads),
> I'd be grateful for your thoughts. One specific question I have is
> what text covers scientific programming and touches on MPI using
> the C language.
>
> regards,
>
> Nathan Moore
>
>
> --
> - - - - - - - - - - - - - - - - - - - - -
> Nathan Moore
> Assistant Professor, Physics
> Winona State University
> AIM: nmoorewsu
> - - - - - - - - - - - - - - - - - - - - -
> _______________________________________________
> Beowulf mailing list, Beowulf at beowulf.org
> To change your subscription (digest mode or unsubscribe) visit
> http://www.beowulf.org/mailman/listinfo/beowulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.beowulf.org/pipermail/beowulf/attachments/20071120/42ae72e6/attachment.html>
More information about the Beowulf
mailing list