- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
! -------------------------------- Module --------------------------------
module mod
type render_config
real :: e(400)
integer xpix
integer ypix
integer :: iso_num
end type render_config
type render_data
type(render_config), pointer :: rc
real, pointer :: isv(:)
real, pointer :: rays(:,:,:)
integer, pointer :: img(:,:)
end type render_data
contains
subroutine render_pixels(rd)
type(render_data) :: rd
integer :: i,a
a=5
!$OMP PARALLEL SHARED(rd) PRIVATE(a)
!$OMP DO SCHEDULE(DYNAMIC,1)
do i=1,30
write (*,*) "i=",i
end do
!$OMP END DO NOWAIT
!$OMP END PARALLEL
end subroutine render_pixels
subroutine init_rd(rd,rc)
type(render_config), target :: rc
type(render_data) :: rd
rd%rc=>rc
if(.not.associated(rd%rays)) allocate( rd%rays(3,rd%rc%xpix, rd%rc%ypix ))
if(.not.associated(rd%img)) allocate( rd%img(rd%rc%xpix, rd%rc%ypix ))
if(.not.associated(rd%isv)) allocate( rd%isv(rd%rc%iso_num))
end subroutine init_rd
subroutine clear_rd(rd)
type(render_data) :: rd
if(associated(rd%rays)) deallocate( rd%rays)
if(associated(rd%img)) deallocate( rd%img)
if(associated(rd%isv)) deallocate( rd%isv)
end subroutine clear_rd
end module mod
! -------------------------------- Program --------------------------------
program fraytracer
use mod
type(render_data) rd
type(render_config),target :: rc
rc%xpix=12
rc%ypix=12
rc%iso_num=20
call init_rd(rd,rc)
call render_pixels(rd)
write (*,*) "- S1 -"
call clear_rd(rd)
write (*,*) "--- E1 ---"
write (*,*) "--- E2---"
write (*,*) "--- E3 ---"
end program fraytracer
---------------------------------- ------------------------------------------------------------------- ---------------------------------
Write above code to file bug.f90 and compile it by:
ifort -openmp -real_size 64 -c bug.f90
ifort -openmp -real_size 64 -o a.out bug.o
and run:
.\\ a.out
After that you will see:
(...)
Script: - S1 -
Script: *** glibc detected *** free(): invalid pointer: 0x0000003c01415000 ***
-- and crash --
Tell me why when I comment last line in program (!write (*,*) "--- E3 ---") program dont crash and i can see:
--- E2 ---
on screen?
If i change line "real :: e(400)" to "real :: e(20)" program will be work.If i don't use "-openmp" program will be work too.
My fortran compiler is:Version 10.1
Tell me pleas - what i should to do to use openMP and don't have strange compiler behavior?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems likely to be impacted by the stack limits you have set (or not set) in your shell. Unfortunately, it's up to you to set sufficient limits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There does seem to be bugs in the 10.1 and 11.x compilers. This code runs fine with Composer XE 2011 (aka 12) Update 1 and Update 2. There will be no further updates to the 10.1 compiler, and currently there are no more updates scheduled for 11.1 either.
Please upgrade to the 12.0 compiler.
ron
Please upgrade to the 12.0 compiler.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you tell me which limits(and how to change it)? Witch limits are related witch "-openmp" compiler option? (becouse every thing (every limits) is ok when I don use "-openmp" option when I compile program)
I can't upgrade ifort - becouse im only user of cluster - no administrator :/
I need some workaround...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some workaround to work witch ifort 10.1 and openMP. Just use "-trace" compiler option (you lost something about 5% of speed of your application) . But in this case that is writen above - that workaround doesn't work. But it work if you have error (wchih apear and disapear randomly if you change sometching in your code) like this:
forrtl: severe (41): insufficient virtual memory
forrtl: severe (41): insufficient virtual memory
(when you use "-openmp" option ofcourse)

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