Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28477 Discussions

Using the Debugger with Auto-Parallelization

moe_satch
Beginner
343 Views

Greetings,

I'm trying to compile some old code that could really make use of the new multi-processor computer in the office. However, if I use the flages "-fast -parallel -mtune=pentium4", the program terminates prematurely without error. If I compile with no special flags, the program runs as it does on the 32-bit Windows machine compiled using Lahey v5.7. However, there is no performance increase.

So I'm trying to find out why the program is exiting early when using the optimizing flags. But, if I use the debug flag '-g', no auto-parallelization is done. Is there a way to debug programs that use the auto-parallelization? Thank you for your time.

Also, please make answers as simplistic as possible, I'm new to this. Thanks.

0 Kudos
4 Replies
TimP
Honored Contributor III
343 Views
-g sets -O0. You will want to add back in some of the flags implied by your full optimization options, and get an idea which ones work for you, e.g -g -O2 -xW, then add -parallel. Depending on your application, of course, OpenMP directives may be much more effective than auto-parallel. But first, you need to find out what is breaking. If your failure is due to un-initialized data or array out of bounds, adding -C should help you debug.
0 Kudos
moe_satch
Beginner
343 Views

Wow,

Thank you for such a timely response.

Just so I understand this, the order in which the flags are set will allow me to use the debugging options with the optimization, i.e. -g before any of the others?

Also, what are a OpenMP directives? Just a basic answer will do to give me a direction to look for documentation, thanks.

I will try the -C flag, as there is a lot of implicit types in this code. It's modified MODFLOW if anyone has had any experience with it.

Thanks again for all the help.

0 Kudos
TimP
Honored Contributor III
343 Views

It should make no difference where you put -g in the list of options.
www.openmp.org has good introductory tutorials, and you should find material in the docs directory of your compiler installation. The companion threading forum is a good place for questions. Auto-parallelization done by the compiler is like automatic OpenMP; with the OpenMP directives, you specify which loops are parallelized, which variables are private (to the thread), whether you want a schedule other than default (guided is good for triangular loops). The compiler is fairly conservative about auto-parallel; in case it doesn't recognize parallel opportunities in your code, OpenMP allows you more hands-on control, and the opportunity to find by trial and error which parallelizations are valid.
0 Kudos
m_m_vincent
Beginner
343 Views

tim18,

Sorry for the delay, but I wanted to thank for your help and the additional information you provided. It has been very helpful.

0 Kudos
Reply