I want to develop a parallel scientific computation software from scratch. I want some thoughts on which language to start. The program involves reading/writing data to txt files and doing heavy computations in parallel, with many LU factorizations and the use of sparse linear solvers. The candidate solutions I was thinking are Fortran 2003/2008 with OpenMP or co-array, C++ with openmp cilk+ or TBB, python. Any other, documented, suggestions are welcome! I know very well C, Fortran and Java (in that order). I've done some scripting in python but basic stuff.I know fortran is very fast, but, hard to maintain and parallelize. C++ is said to be slow unless you use external libraries etc Python I like, but is it realistic to write a full scale, industrial level software upon?The software needs to be able to handle big amounts of data and be effective with scientific computations. The performance is of the essence.For the background, I already have a working software written in Fortran. Many people were involved in development over many years and the code is really dirty. Maintaining and parallelizing the code has proved a nightmare and I'm thinking of alternatives.Petros
Parallel Scientific Computation Software Development Language?
python;hpc;c++;fortran;simulation
Let me try and break down your requirements:MaintainabilityReading/writing text dataStrong interfaces/capability for LU factorizationsSparse linear solversPerformance and scalability to large dataFrom this list, I would consider the following languages:C, C++, Fortran, Python, MATLAB, JavaJulia is a promising new language, but the community is still forming around it and it has not been deployed in any major new codes.Reading/writing text dataThis is easy to get right in any programming language.  Make sure you are appropriately buffering and coalescing your I/O access, and you will get good performance from any of the languages you should consider.  Avoid the stream objects in C++ unless you know how to use them performantly.Strong interfaces/capability for LU factorizationsIf you are performing dense LU factorizations, you will want to use LAPACK, or ScaLAPACK/Elemental for parallel functionality.  LAPACK and ScaLAPACK are written in Fortran, Elemental is written in C++.  All three libraries are performant and well-supported and documented.  You can interface into them from any of the languages you should consider.  Sparse linear solversThe premier freely available sparse linear solvers are almost all available through PETSc, written in C, which is well-documented and supported.  You can interface into PETSc from any of the languages you should consider.Performance and scalability to large dataThe only parallel programming paradigms you mention are shared memory based, which means you are not considering an MPI-based (message-passing), distributed-memory computing approach.  In my experience, it is much easier to write code that scales well beyond a dozen cores using a distributed-memory solution.  Almost all University clusters are MPI-based these days, large shared-memory machines are expensive, and correspondingly rare.  You should consider MPI for your approach, but my advice will apply regardless of the programming paradigm you choose.With regards to on-node performance, if you are writing numerical routines yourself, it is easiest to get good serial performance in Fortran.  If you have a little bit of experience in C, C++, or Python, you can get very comparable performance (C and C++ are dead-even with Fortran, Python and MATLAB come within about a 25% time overhead without much effort).  MATLAB does this through a JIT compiler and very good linear algebra expressivity.  You will likely need to use either Cython, numpy, numexpr, or embed numerical kernels to get the claimed performance from Python.  I can't comment on Java's performance, because I don't know the language very well, but I suspect it is not far from Python's if written by an expert.A note on interfacesI hope I've convinced you that you are going to be able to do everything you want in any of the programming languages you are considering.  If you are using Java, the C interfaces will be a little challenging.  Python has excellent C and Fortran interface support through ctypes, Cython, and f2py.  LAPACK is already wrapped and available through scipy.  MATLAB has all of the functionality you need in its native libraries, but is not readily scalable or particularly easy to run on clusters.  Java can support C and Fortran interfaces with the JNI, but is not commonly found on clusters and in parallel software for scientific computing.MaintainabilityA lot of this is going to come down to personal flavor, but the general consensus on maintainability is that you want to minimize the number of lines of code in your software, write modular code with well-defined interfaces, and for computational software, provide tests that verify the correctness and functionality of the implementation.RecommendationI personally have had a lot of luck with Python and I recommend it for many computational projects.  I think you should strongly consider it for your project.  Python and MATLAB are probably the most expressive of the languages available for scientific computing.  You can easily interface Python to any other programming language, you can use f2py to wrap your current Fortran implementation and piece-by-piece rewrite whichever parts you wish in Python while verifying that you are maintaining functionality.  At this time, I would recommend a combination of the official Python 2.7 implementation with scipy.  You can get very easily started with this stack from the freely available Enthought Python Distribution.You could also do most of this in C, C++, or Fortran.  C and C++ are very appealing languages for professional developers with a lot of experience, but frequently trip new developers and are in this sense probably not a great idea for a more academic code.  Fortran and MATLAB are popular in academic computation, but are weak at the advanced data structures and expressivity Python offers (think of a Python dict object, for example).Related Questions:Recommendations for a usable, fast Java matrix library?