- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The ifort documentation (for linux) mentions the use of `parallel lint' to verify OpenMP code.
Is parallel lint an intel product (or part of one)? I could not find anything on the web site.
Thanks,
Mirko
The ifort documentation (for linux) mentions the use of `parallel lint' to verify OpenMP code.
Is parallel lint an intel product (or part of one)? I could not find anything on the web site.
Thanks,
Mirko
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The parallel lint you're referring to is part of the compiler. It performs a static global analysis of your OpenMP program. Compiling with -openmp -diag-enable sc-parallel3 will produce verbose diagnostics.
Patrick Kennedy
Intel Developer Support
Patrick Kennedy
Intel Developer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ah! (or duh!)
thank you,
Mirko
thank you,
Mirko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I spoke too soon (maybe time for another `duh').
I tried the ifort -openmp -diag-enable sc-parallel3 -c test.f90 command on the following code (an example from the Parallel Lint section):
Thanks,
Mirko
I tried the ifort -openmp -diag-enable sc-parallel3 -c test.f90 command on the following code (an example from the Parallel Lint section):
[bash]parameter (N = 10) integer i integer, dimension(N) :: factorial factorial(1) = 1 !$OMP PARALLEL DO do i = 2, N factorial(i) = i * factorial(i-1) end do print *, factorial end [/bash]I don't get an error report. What else needs to be done?
Thanks,
Mirko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting. If I set -parallel -par-report2 it reports "existence of parallel dependence," so the analysis capability is there somewhere.
When I run this, there's no evidence of use of a second thread, possibly because the loop is so short.
When I run this, there's no evidence of use of a second thread, possibly because the loop is so short.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This may not be documented, butlint requires interprocedural (whole program) analysis to work, and you don't get that if compiing with -c. Just remove the -c:
Patrick Kennedy
Intel Developer Support
> ifort -openmp -diag-enable sc-parallel3 test.f90 test.f90(8): warning #12246: flow data dependence from (file:test.f90 line:8) to (file:test.f90 line:8), due to "FACTORIAL" may lead to incorrect program execution in parallel mode
Another quirk is that '-diag-enable sc-parallel3' just does lint, and no executable is produced. So remove those flags to make an executable:
> ifort -openmp test.f90 && ./a.out
1 2 6 24 120 720
0 0 0 0
Clearly the compiler was onto something, as the last four outputs are not the factorials of {7,8,9,10}. You'll get the correct answer with one thread:> export OMP_NUM_THREADS=1
> ./a.out
1 2 6 24 120 720
5040 40320 362880 3628800
>
Patrick Kennedy
Intel Developer Support

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