Checking loops for independence

i would just like to use the software to check a program’s functions and determine if some loops are parallelizable or the loop’s iteration sequences are dependent. What command line options should I use to just do that? There is no need to put ta=nvidia unless I have to. I tried -Minfo and got nothing.

I just compiled the program, but instead of using gcc I put in pgcc. Now what else must I put in to get this software codes loop information?

These loops are very complicated and you cannot determine independence by inspection.easily

Any help appreciated.

THX 1138

Hi THX 1138,

As part of optimizing code, pgcc will perform a loop dependency analysis. So if you add an optimization flag, such as “-Mconcur” which enables auto-parallaleization, and “-Minfo”, the compiler will tell you if it’s parallel or not. Granted, the dependency analysis does have it’s limits, so if the code is over complex, it may fail to determine independence. Also, since you’re compiling C code, you do have to worry about pointer aliasing. Hence, be sure to use the “restrict” keyword, or add the flag “-Msafeptr” to assert all pointers do not overlap.

  • Mat