IPA inhibited: no main routine

When I compile with -Mipa=fast I get this message after linking :

IPA inhibited: no main routine

I use -c --mp -fastsse -O4 -tp=athlonxp -Minline=levels:10 -Mipa=fast when compiling my single files and also -Mipa=fast when linking. I have found no references to this problem on the web.

What does this mean and how do I fix it?

Hi Tyler,

This error occurs when the main program was not compiled with IPA. Please double check that all your files were compiled using “-Mipa=fast”.

If all your files were compiled with IPA, would it possible to send a complete log of your build to trs@pgroup.com? (I’m assuming it would be too long to be posted here.)

Thanks,
Mat

I do have a main in Main.cpp and it is compile with -Mipa=fast
here is the complete log of my build (it’s not too long):

pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/GA.o src/GA.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/KinematicModel.o src/KinematicModel.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/Main.o src/Main.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/NeuralConnections.o src/NeuralConnections.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/NeuralController.o src/NeuralController.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/NeuralPathways.o src/NeuralPathways.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/TGA.o src/TGA.cpp
pgCC -Iinclude  --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -c -o obj/Unit.o src/Unit.cpp

linking ...
pgCC  obj/GA.o  obj/KinematicModel.o  obj/Main.o  obj/NeuralConnections.o  obj/NeuralController.o  obj/NeuralPathways.o  obj/TGA.o  obj/Unit.o --mp -fastsse -O4 -tp=athlonxp  -Minline=levels:10 -Mipa=fast  -lrandomae -lrt    -o bin/evolve
C++ prelinker: executing: /opt/pgi/linux86/5.2/bin/pgCC -Iinclude --mp -fastsse -fast -Mvect=sse -Mscalarsse -Mcache_align -Mflushz -O4 -tp=athlonxp -Minline=levels:10 -Mipa=fast -o obj/GA.o -c src/GA.cpp

IPA inhibited: no main routine

here is Main.cpp:

#include "GA.h"
#include "Utilities.h"
#include "Profiler.h"

int main()
{
  RandomInit(RANDOM_SEED);

  Profiler prof;

  GA ga;

  prof.Start();  
  ga.Start();
  prof.End();
  
  prof.PrintResult();
  
  return 0;
}

thanks for your time

Hi Tyler,


Let’s try some things to determine where the problem is. First “–mp” is a deprecated flag and shouldn’t be used (Note, for openMP the flag is “-mp”). Try compiling without “–mp” to see if it is causing the problem. Next, try compiling with just “-O2 -Mipa=fast”. If this works, then start adding back the other flags. Let me know at what point it starts to fail.

As a side note, I find IPA doesn’t always help the performance of C++ code so you might be fine without it. Also, if you don’t use exception handling, I find that adding “–no_exceptions” can help significantly.

Thanks,
Mat

I tried “-Mipa=fast -O2” and it still complained about duplicate symbols, but with just “-Mipa=fast” it worked, and as you said it gave me no performance gain. So far the best performance was obtained with “-mp -O4 -fastsse -tp=athlonxp -Minline=levels:10”, almost doubling the execution speed (as compared to no optimization).

One last question: I tried the multi-threaded version of my program (with pthread, dual Athlon MP) and got these results:

-with gcc :

  • serial -> 41.67 sec
    mt -> 23.91 sec (174%)

-with intel_cc :

  • serial -> 31.22 sec
    mt -> 21.49 sec (145%)

-with pgCC :

  • serial -> 43.74 sec
    mt -> 55.49 sec (79%)

why does the pgCC version drop in speed when I use my two processors (I checked and the mt version with pgCC does in fact max out my cpu usage to 99% on both cpus)?

thank you ,
David

Hi David,


Unfortunately, I don’t know why our openMP performance actually degrades at two threads. I’ve seen this issue on SuSE 9.0, but this is a problem with pthreads and occurs with all compilers. We’d need to work with the code in order to determine what’s going on, since we’ve obviously got an issue. Admittedly, our C++ perfomance does lag. We’ve mostly focused our efforts on Fortran and C performance. You’ll some gains with the upcoming 6.0 compiler, but even more with future releases. Granted, this doesn’t help you now. We would appreciate if you would submit a bug report to trs@pgroup.com so we can diagnosis and fix the problem.

Thanks,
Mat