- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Can anyone explain while the following code causes a general access violoation (exception code c0000005) when run in parallel (/Qopenmp is specified):
Program
mainimplicit noneinteger nareal(8) objreal(8), allocatable:: a(:)na = 100
allocate( a(na) ) call sub1 (na, a, obj)deallocate ( a )stopend
program mainsubroutine
sub1(na, a, obj)implicit noneinteger nareal(8) a(na), objinteger i, icnta = 0.0
obj = 0.0
icnt = 0
!$omp parallel do &!$omp private (obj) &!$omp firstprivate (a) lastprivate (a) &!$omp reduction (+:icnt)do i=1,4a(1:na) =
real(i)obj =
sum(a(1:na))icnt = icnt + 1
write(6,*) i,': ', objend do!$omp end parallel dowrite(6,*) 'icnt = ', icntreturn
end subroutine
sub1If I remove the reduction clause, then the code does not cause the access violation, and runs correctly.
I'm using the latest version of IVF and running on Vista x64. Also, if i statically allocate arrary a in the
main program, program runs fine.
thanks
-joe
Link Copied
0 Replies

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