- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]!dec$ if defined (_PARALLELIZATION_) !$omp parallel if ( enableOpenMP ) num_threads ( threads ) default ( shared ) ... !dec$ end if[/cpp]_PARALLELIZATION_ is a preprocessor directive; enableOpenMP is a logical variable which can be influenced by users.
My problems with debugging occur when I use _PARALLELIZATION_ in the Debug configuration. Even though enableOpenMP is set to .false., the debugger does not work properly - conditional breakpoints are not hit and stepping (F10) through the region which could be made parallel (by setting enableOpenMP to .true.) skips some lines in the region.
The behavior is correct after removing _PARALLELIZATION_ from the preprocessor directives.
Compiler options used are:
/nologo /debug:full /Od /gen-interfaces /fixed /extend_source:132 /Qopenmp /fpscomp:general /debug-parameters:used /warn:declarations /warn:truncated_source /warn:interfaces /assume:byterecl /traceback /check:pointer /check:bounds /check:uninit /check:format /check:arg_temp_created /libs:static /threads /dbglibs /c /align:all /heap-arrays
I am using MS Visual Studio 2008 and IVF 11.0.072.
Are there any recommendations how to debug (possibly) parallel programs?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jirina,
In the above source code!dec$ if defined (_PARALLELIZATION_) is .NOT. a preprocessor directive. It is a conditional compilation directive. The preprocessor, FPP, is enabled with -fpp and look very similar to the C preprocessor
#ifdef _PARALLIZATION_
...
#endif
where _PARALLIZATION_ is defined using #define _PARALLIZATION_ or as an option -D_PARALLIZATION_=asdf
You have two ways of conditional compilation, one using the Fortran !DEC$ and the other using the FPP #if.
You might try using the FPP preprocessor to work around the problem you are experiencing.
Also, the !$OMP... become comments when OpenMP disabled. Therefore many of your conditional compilation directives might be removed. (and thus many of the sources to your line number problems).
And, you cannot (usually) F10 across a parallel region boundry. (place a break point after boundry and use F5)
The !dec$ if defined (_PARALLELIZATION_) problem should be reported to premier support along with a simple program exhibiting the problem.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried /fpp and #ifdef / #endif, but it did not help to resolve the problem. Anyway, thank you for your suggestion.
I use _PARALLELIZATION_ not only for !$OMP, but also for other stuff in my program (related to parallelization), so I would like to keep the conditional compilation. I hope it does not matter.
I have just submitted the issue with conditional breakpoints, including a small program exhibiting the problem; the issue number is 544550.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page