Compiling Code for Prince
We recommend using the Intel compiler suite (
module spider intel), and, for MPI programs, OpenMPI (
module spider openmpi/intel).
The GNU compiler suite is also available (module spider gcc) and over time other compiler versions and MPI implementations will be installed. There will be instances in which an alternative compiler or MPI library performs better or avoids a bug in the recommended compilers, but in the long run the functionality and performance of compilers and MPI libraries is very similar, so for easiest maintenance, only use the alternatives if you really need to.
For the best performance, you should compile your code optimized with AVX2 vector instructions for faster floating point computations, also to generate multi-threaded code based on the OpenMP* directives. To do so, use the following flags to
For the link step, you can add a flag "-shared-intel".
If you need GNU compilers, we recommend enabling AVX and disabling AVX2 instructions to ensure your executable can run on any compute nodes. To do this add the flag:
If you are building software to use for many or long-running jobs, testing for performance with a few MPI libraries and compile options can be very valuable since a specific model might run noticeably faster under one MPI implementation than another.