I was away on my travels last week, so I missed the first Code Coffee of the new term here in Oxford. Joe Zuntz was present to officiate, though, and led a discussion (allegedly) for the benefit of our new doctoral students, who’d just arrived at that point. The result was a collection of “one-line guides” on getting started with astrophysics-style computing and programming, which I’ve copied below. (Be warned: It’s a little Oxford-specific in parts.)
- StackOverflow website for asking questions
- IRC channels – freenode – for open source projects
- Software Carpentry website
- OUCS training (wide range of IT courses)
- OERC training (mostly supercomputing and parallel computing)
Don’t code maths!
- Linear Algebra: (Scala-)Lapack/BLAS veclib on a Mac, or Intel Math Kernel Library (MKL). GNU Science Library (GSL), DOE Libraries, NAG libraries.
- Fourier Transforms: FFTW/MKL. Make your arrays length 2^n * 3^m * … (few small prime factors).
- Numerical Recipes: Read (for free online), but don’t use the code. The C version has messed up array indices.
- Netlib: Website with collection of old scientific/maths code. Mostly F77. e.g. slatec.
- slalib: Positional astronomy library, for dealing with astronomical coordinates and times.
General coding advice
- Don’t invent your own file formats.
- FITS tables are not a great format. Consider using HDF instead.
- GNU: gcc, g++, gfortran (freely-available, cross-platform)
- Intel: icc, ifort (tend to be faster for some applications)
- Avoid mixing Intel/GNU compilers, and different versions of the compilers, when using Fortran. The compiled Fortran modules that are produced may not be compatible between different versions.
- Software carpentry
- Best practices paper (for what it’s worth, I think following all of this advice would be a bit too ambitious for a good many astro projects…)