Intel® HPC Toolkit
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

Effect of -g on


I'm realizing that including -g in my compile statement causes my MPI C++ program executable to link with rather than (v13/impi/ Can anyone explain exactly why that is so and whether there is necessarily an associated impact on performance?

A simple C++ code calling only MPI_Init compiled with mpicxx and with or without -g is sufficient to demonstrate the behavior.

0 Kudos
1 Reply

Hi David,

By using -g in your compile/link line, you're basically telling Intel MPI you want to link with the debugging version of our library ( which includes debug symbols embedded in the lib.  Details are in the Compiler Command Options section of our Reference Manual.

We haven't seen any major performance issues when linking with the debug Intel MPI.  The library will print a *lot* more additional information when I_MPI_DEBUG is enabled though.  Keep that in mind.  If you don't need to link with the debug version, you can simply leave the -g out of the compile line.

In later versions of Intel MPI (latest available is Intel MPI Library 5.1.2), we've actually included debug symbols in the regular there's no special need to link with -g.

I hope this helps.  Let me know if you have any specific questions about using our debug builds.


0 Kudos