Segmentation fault when calling a subroutine

Segmentation fault when calling a subroutine

I am calling the lapack subroutine DLAPMT in the following snippet of my code:

c    Permute matrix c_all according to IPERM1 

    do i=1, n_sources
        do k=1,g_layers
            do l=1,n_layers
            call DLAPMT (.TRUE., nsim, ndim, c_all(:,:,i,k,l), nsim, IPERM1)
            enddo
     
        enddo
    enddo

 

In this case n_sources is 2, g_layers is 1 and n_layers is 1.  Therefore it should call DLAPMT twice.  The first time it works fine.  The second time it reaches DLAPMT, it kills the process due to a segmentation error. I've checked and all the inputs are exactly the same the second time around.  What could be causing this problem?

 

Thanks

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Is the LAPACK library you're calling the one from Intel MKL or something else? You say "segmentation fault", which is a Linux term - are you using Windows (this forum) or Linux? What happens if you add /heap-arrays (-heap-arrays) to the compile options?
 

Steve - Intel Developer Support

I'm using Linux, sorry about that.  It is from the Intel MKL library.  I'll try the heap-arrays option

Thanks

That worked, thanks!

Ok - looks as if you're getting a stack overflow and the compiler is creating a stack temp and not removing it, but I don't think it should need a temp here. Can you provide me with a small but complete source that shows the problem?

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today