Tuesday, November 2, 2010

Understanding -DOMPI_SKIP_MPICXX Flag for compiler/linker settings

When I was compiling LAMMPS, I come across this Flag when preparing the compiler/linker settings
CCFLAGS =       -g -O -I/usr/local/fftw/include -DFFT_FFTW -DOMPI_SKIP_MPICXX -DOMPI_IGNORE_CXX_SEEK

What do -DFFT_FFTW -DOMPI_SKIP_MPICXX really mean? The answer is nicely given Rolf Vandevaart "Speeding Up C++ Compiles"

In a summary, from the blog
The issue is that if you are compiling C++ code, but you are not using the C++ bindings, the code can be slow to compile.  The workaround is to use the -DOMPI_SKIP_MPICXX flag which tells MPI not to include the C++ header files
And here are the results.  Not quite a 50% speedup, but close

No comments: