17 ms·
I work on numerical simulations, where I deal with colossal arrays of floating point numbers on hundreds or thousands of nodes. I want tools that can help with
by amplitwist 14y ago
I work on numerical simulations, where I deal with colossal arrays of floating point numbers on hundreds or thousands of nodes. I want tools that can help with the following:
1. Visualizing code. Rendering C++ and/or Fortran as LaTeX would be very helpful for lines of code like this, where I've spent too much time tracking down misplaced parens:
k1(1,1)=-Im*(Omega_minus_n*(rho13(i,j)+conjg(rho12(i,j)))-Omega_plus_n*(rho12(i,j)+conjg(rho13(i,j))))+gamma1*(rho22(i,j)+rho33(i,j))
2. A better way to debug and test mathematical programs. Debugging is extremely hard when you have thousands of processes doing calculations that aren't reproducible by hand, so it's very difficult or impossible to create test cases for subunits of the program. The only tests are Fermi calculations and comparison of the whole program's output with an analytical solution, which is often not possible, and is not useful for debugging.
3. A language with the following characteristics:
- Within 10% of Intel/PGI Fortran on tight numerical loops
- Array and distributed/concurrent syntax with lightweight threads and syntactical support for GASnet/MPI.
- Parallel load balancing, preferably across nodes. A few of the algorithms I use are adaptive or have parts of the solution domain that require much more work than other parts, leading to situations where naive/maintainable MPI code leaves most processors idle.
- Hindley-Milner type inference, typeclasses/typeclass-like features, operator overloading/syntax extension, and effortless interoperation with C/Fortran. An IDE with syntax rendering like Maple or Mathematica's would be a HUGE plus. I don't know why this doesn't exist for usably fast languages.
- Supports an interactive mode with easy visualization
The closest language I've seen is Cray's Chapel, but there are several things I don't like about it. Its imperative/oo design and lack of first class functions/tco are unacceptable, since the algorithms I use need to use the integer side of the machine as well as the floating point ones. Right now I use either Charm++ (http://charm.cs.uiuc.edu/ http://charm.cs.uiuc.edu/) with Intel's array syntax, or Fortran 2008 for some inherited code. C++ has non-ideal semantics for numerical code, and doing non-trivial algorithms in Fortran is still a nightmare, especially when using MPI, as communication code quickly becomes the main part of the program. Something like Sisal (http://sourceforge.net/projects/sisal/ http://sourceforge.net/projects/sisal/), if it was modernized and extended to distributed architectures, would be amazing. It used to beat typical Fortran by 20%.
4. I absolutely need to account for cache behavior, otherwise my simulations will take months to run instead of weeks. I would love anyone who wrote a practical tool that automatically tiled loops, since doing this manually turns code into an unmaintainable rat's nest very quickly, or wrote a library of skeletons for tiled loops and cache oblivious algorithms.
- yolesaber 14y agoIn regards to 1: Any decent editor should have highlighted parens matching. What do you use for coding?
- amplitwist 14y agoEmacs, but it's still hard to do. That code excerpt is nothing compared to what I have worked with in some code I no longer I have access to; some of the formulas stretched on for about 6 lines of 80 chars each. It's not so much the unbalanced parens as it is about having the wrong thing in the denominator of a gigantic multilevel fraction.
- ajdecon 14y agoRe 3: I don't think anything like this exists yet (as you've described close to the "holy grail" of numerical languages ;-) ), but you might want to check out Julia[1] if you haven't done so yet. It doesn't do everything you want, but has decently good performance, makes it easy to call C libs (and Fortran I think), and is doing some interesting things with parallelization. Unfortunately it doesn't yet have MPI support, the performance you want, etc. but it's a very new language with an active community, and I think it has goals compatible to yours. Re 1: As yolesaber said, most decent IDEs/editors should give you tools to deal with parens. As for pretty-printing equations: I used to have a Perl script that would convert code to LaTeX according to certain rules, but it's lost in a previous job's IP. Still, this should be reasonably achievable with a set of regexs + LaTeX assuming you use a consistent syntax throughout for your equations, without too many ambiguous cases. :) [1] http://julialang.org/ http://julialang.org/