I am about to start a new project in scientific computing, which will run on a computer cluster using from 8 up to 32 CPUs. I will use MPI to distribute the calculations. The last thing is which language is better to use C or C++? I will do some serious number crunching, and I will need a smooth and well-distributed parallelization. I have no experience using MPI, but I am aware that it suits C much more than C++, even if libraries like boost::MPI are used. Taking into account that performance is crucial, what language is better to use?
Note: Of course, one could write C-style code on C++, but that wouldn’t be C++ after all. When I speak of C++ I mean to use lots of OOP and generic programming.
You can write slow code in any language. MPI is a message-passing library so it simply does not care whether you call it from C or C++ — use whichever language you are better at.
Which you should determine by profiling and measuring.
The Language Shootout comparison between C and C++ is pretty even about size, speed and memory use.
Lastly, there is also the underestimated importance of ‘time to code’. You may get to a working program faster in C++ than in C simply because you have more high-level tools at your disposal. Or you may not, so I would try to measure.