Thanks for the message Peter. I agree with you about the lucidity of K&R, although I think the Landau-Lifshitz series of texts eclipses it in overall greatness. <br><br>Regarding demographics, I'm thinking mainly about the device driver/embedded systems/EE track, in which a fortran interface seems to be unheard of. The only field I know of in which Fortran is common and vital is numerical weather modeling. Maybe others on the list can disabuse me of this notion.
<br><br>Also, the truck full of gravel analogy is great, thanks!<br><br><div class="gmail_quote">On Nov 20, 2007 1:30 PM, Peter St. John <<a href="mailto:peter.st.john@gmail.com">peter.st.john@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Nathan,<br>I'm sure you'll get lots of very experienced responses but if I may:<br>1. Book. K&RC is the best book ever, on any subject.
<br>2. Demographics. It looked to me that engineers were typically<br>learning and using C (C++, C with Classes, sometimes Java) more than<br>Fortran. I would have expected similar among physicists, but I<br>understand that a lot of Fortan is still extant and vital. Also there
<br>is some convergence, ultimately it won't matter much.<br>3. Pedagogy. When computational efficiency is important, the<br>distinctions bettween sending data, and sending references to data, is<br>real important. I think it can be made vivid, early; what's the
<br>difference between my handing you a card with the shipping address of<br>the warehouse that has the gravel you need for your construction<br>business, and handing you one thousand wheelbarrows full of gravel?<br>Either way can be right in the circumstances, but the difference is
<br>obviously very relevant and should be taught even if you use a<br>language that hides the distinctions.<br>4. You might let them choose, but that might make more sense with<br>graduate students, than undergrads, and you may not like grading
<br>papers in multiple languages. So you might ask about departmental<br>guidelines, what languages they will be exprected to learn anyway. I'd<br>advocate presenting some of the shorter but fundamental algorithms in<br>
two languages, if you have time, but time is scarce and it's a physics<br>course, not a programming course.<br>5. Choose C because there is no real choice, but I don't have time to<br>explain that in the margin of my email :-)
<br><font color="#888888">Peter<br></font><div><div></div><div class="Wj3C7c"><br><br>On Nov 20, 2007 1:33 PM, Nathan Moore <<a href="mailto:ntmoore@gmail.com">ntmoore@gmail.com</a>> wrote:<br>> I regularly teach a college course in a physics department that deals with
<br>> scientific computation. After students take the course, I expect that<br>> they'll be able to write simple "c-tran" style programs for data analysis,<br>> write basic MD or MC simulations, and be fairly fluent in Mathematica.
<br>><br>> In the past, I figured that with the breadth of topics included in the<br>> course, Fortran, specifically the basic, simple, and reliable F77 dialect<br>> (w/ some F90 conveniences) was the language to teach. In my own head, my
<br>> rationale was:<br>> - Most students can grasp the basics of fortran in half a day's reading, so<br>> I can spend more class time on science and math (probably because there are<br>> no pointers - I think that C is much harder for students and sometimes
<br>> "seems" less like mathematical syntax than f77)<br>> - "Classical Fortran" is a great text and is readable for self-study (I know<br>> of no such text for C/C++)<br>> - several free compilers exist (g95 seems ok so far)
<br>> - Netlib, lapack, and numerical recipes cover the math library adequately<br>> - F77 is compiled (Perl/python are too slow for an MD/MC sim and I figure<br>> that students should know at least on compiled language and one scripting
<br>> language to be competent)<br>> - MPI is a relatively basic addition to the language (again, no pointers,<br>> allocation, or addressing)<br>><br>> After reflection though, I've started to wonder about the wisdom of my
<br>> choice. Specifically (like RGB), I love the GSL library, and extending GSL<br>> to fortran in an intro class is non-trivial. Additionally, most vendors<br>> supply "fast" hardware libraries in C (I may be ignorant, but if a student
<br>> wants to call an AMD ACML fast-math function(<br>> <a href="http://developer.amd.com/acml.jsp" target="_blank">http://developer.amd.com/acml.jsp</a>), or write a linear algebra function to<br>> run on a graphics card(
<a href="http://developer.nvidia.com/object/cuda.html" target="_blank">http://developer.nvidia.com/object/cuda.html</a> ), the<br>> vendors seem to assume that you'll write the code in C).<br>><br>> Also, and more relevant, I assume that most employers word-associate
<br>> "Fortran is to backwards as C is to competence".<br>><br>> So, I'm thinking about reworking the class to favor C, and fearing 3 weeks<br>> of pointer and addressing hell. For those of you who teach scientific
<br>> computation (and also those of you who hire undergrads), I'd be grateful for<br>> your thoughts. One specific question I have is what text covers scientific<br>> programming and touches on MPI using the C language.
<br>><br>> regards,<br>><br>> Nathan Moore<br>><br>><br>> --<br>> - - - - - - - - - - - - - - - - - - - - -<br>> Nathan Moore<br>> Assistant Professor, Physics<br>> Winona State University
<br>> AIM: nmoorewsu<br>> - - - - - - - - - - - - - - - - - - - - -<br></div></div><div><div></div><div class="Wj3C7c">> _______________________________________________<br>> Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">
Beowulf@beowulf.org</a><br>> To change your subscription (digest mode or unsubscribe) visit<br>> <a href="http://www.beowulf.org/mailman/listinfo/beowulf" target="_blank">http://www.beowulf.org/mailman/listinfo/beowulf
</a><br>><br>><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>- - - - - - - - - - - - - - - - - - - - - <br>Nathan Moore<br>Assistant Professor, Physics<br>Winona State University<br>AIM: nmoorewsu
<br>- - - - - - - - - - - - - - - - - - - - -