- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Been running with single thread and tried to use a single openmp instruction.
do 95 k = 1, ivfcount
j = ivflist(k)
!$omp parallel DO private(i,j)
do 90 i = 1, nfmaxp2
if (i.le.ncn(j)+2) w(j) = w(j) + (a(i,j) * p(cn(i,j)))
90 continue
!$omp end parallel DO
95 continue
Get the error "forrt1: severe (170): Program Exception - stack overflow" A web search shows this isn't uncommon but trying several fixes that were suggested, haven't fixed the problem.
Running Intel Fortran 11.1 in Visual Studion 2008 on Win7 64-bit.
Thanks for any suggestions.
do 95 k = 1, ivfcount
j = ivflist(k)
!$omp parallel DO private(i,j)
do 90 i = 1, nfmaxp2
if (i.le.ncn(j)+2) w(j) = w(j) + (a(i,j) * p(cn(i,j)))
90 continue
!$omp end parallel DO
95 continue
Get the error "forrt1: severe (170): Program Exception - stack overflow" A web search shows this isn't uncommon but trying several fixes that were suggested, haven't fixed the problem.
Running Intel Fortran 11.1 in Visual Studion 2008 on Win7 64-bit.
Thanks for any suggestions.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In effect, you have a reduction operator here. With the syntax you quote, you have a race condition, with multiple threads updating w(j) at the maximum possible rate. It doesn't look like you should be trying OpenMP in the inner reduction loop. Supposing that you wrote
!$omp parallel do private(j,tmp)
do k=1,ivfcount
j = ivflist(k)
tmp = dot_product(a(1:min(nfpmax2,ncn(j)+2),j),p(1:min(nfpmax2,ncn(j)+2),j))
!$omp ordered
w(j)= tmp
!$omp end ordered
enddo
You would not need the ordered if you could assure that ivlist doesn't contain repeated values, if in fact that's what is meant in this code.
!$omp parallel do private(j,tmp)
do k=1,ivfcount
j = ivflist(k)
tmp = dot_product(a(1:min(nfpmax2,ncn(j)+2),j),p(1:min(nfpmax2,ncn(j)+2),j))
!$omp ordered
w(j)= tmp
!$omp end ordered
enddo
You would not need the ordered if you could assure that ivlist doesn't contain repeated values, if in fact that's what is meant in this code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tim.
Yes, ivflist has no repeated values, just a list of loop values that statisfy a condition.
ivfcount = 0
do 7 j = 1, nelem
if (ivflag(j).ne.1) then
ivfcount = ivfcount +1
ivflist(ivfcount) = j
endif
7 continue
Implementing your suggestion still results in the same failure.
Yes, ivflist has no repeated values, just a list of loop values that statisfy a condition.
ivfcount = 0
do 7 j = 1, nelem
if (ivflag(j).ne.1) then
ivfcount = ivfcount +1
ivflist(ivfcount) = j
endif
7 continue
Implementing your suggestion still results in the same failure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As your search no doubt told you, the most common solutions for stack overflow when introducing OpenMP are attention both to global stack (Microsoft linker properties) and thread stack (KMP_STACKSIZE).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim,
Dumb question(s). I assume I can set the global stack using
Configuation Properties -> Linker -> System -> Stack Reserve Size
Is the thread stack variable set as a comand line addition to Fortran?
Dumb question(s). I assume I can set the global stack using
Configuation Properties -> Linker -> System -> Stack Reserve Size
Is the thread stack variable set as a comand line addition to Fortran?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to define an environment variable, KMP_STACKSIZE, before running the program. It isn't a compile or link option.
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