17 Nov 2007 10:39
allocatable memory and array in subroutine are not private - segfault issue
I am having a problem with prallelizing some code. It seems to be according to
spec but still causes errors.
I have a function called from within a parallel do loop which among other
things has several small arrays and some allocated and deallocated memory. The
spec seems to say that all that memory is private but it seems that different
instances of that function (different threads) stomp each others memory.
I haven't managed to make a minimal example since this depends on timing issues
apparantly but here are the relevant parts of the code (after cutting out what
I believe to be unrelated). This is run under linux and shows a problem with
both the intel compiler and gfortran and is run under intel core 2 duo in 64
bit mode.
There is one omp do loop directive near the start, the problematic function is EigenVecs.
The two points of problem when using more then one thread
1. the call to dsaupd (arpack eigenvalue calculation) tell me that the input values are
wrong (don't know which one because the error comes from farther). Not on the first
run of the loop, but a bit later
2. I get a segmentation fault with the two deallocate directives one line up from the end.
Removing them solves the segfault so there is some double deallocation going on
seems to me that the arrays/allocatable objects are forced to shared for some reason
the code:
-----------
integer function PeronaMalikIteration(in, out, pprms, eprms)
real*8, allocatable :: v(:, :), d(:)
(Continue reading)
RSS Feed