Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Camilo_P_
Beginner
142 Views

SIGSEGV with Poisson Solver

I have been running and debugging a code with the Intel visual fortran composer that uses the MKL poisson solver. It runs without issues in Windows. But when I run it in a UNIX system I get a SIGSEGV error. I am compiling it in 64 bits and I have checked that that is happening. I  have tried: -heap-arrays, ulimit -s unlimited and none of them have fixed the problem. I used -traceback and it points  to the line where I do 

call D_COMMIT_HELMHOLTZ_3D (f, bd_ax, bd_bx, bd_ay, bd_by, bd_az , bd_bz, xhandle, yhandle, ipar, dpar, stat)

The subroutine where this call is:

    subroutine solvePoisson3DVorticityPerMKL(f, bd_ax, bd_bx , bd_ay, bd_by, bd_az, bd_bz, nx, ny, nz, ax, bx, ay, by, az, bz, i)
    double precision dpar(5*(nx+ny)/2+9)
    integer ipar(128), i, stat, nx, ny, nz
    double precision :: bd_ax(:,:), bd_bx(:,:) , bd_ay(:,:), bd_by(:,:), bd_az(:,:), bd_bz(:,:)
    double precision :: f(:,:,:), finish, start
    character(6) BCtype
    double precision q, ax, bx, ay, by, az, bz
    type(DFTI_DESCRIPTOR), pointer :: xhandle, yhandle

    SELECT CASE (i) ! select component
    CASE (1)
        BCtype = 'PPDDPP'
#ifndef SHEAR_FLOW         
        bd_ay  =0
        bd_by  =0
#endif       
    case (2)
        BCtype = 'PPNNPP'

    case (3)
        BCtype = 'PPDDPP'
#ifndef SHEAR_FLOW
        print *,"Unidirectional flow"
        bd_ay  =- 0.1*(bx-ax)/2 ! for unidirectional flow
        bd_by  =0.1*(bx-ax)/2
#endif        
    end select
    q=0.0
    ipar =0

    
    call D_INIT_HELMHOLTZ_3D(ax, bx, ay, by, az, bz, nx, ny, nz, BCtype , q, ipar, dpar, stat)
    ipar(3)=0 ! dissable warnings
    call D_COMMIT_HELMHOLTZ_3D (f, bd_ax, bd_bx, bd_ay, bd_by, bd_az , bd_bz, xhandle, yhandle, ipar, dpar, stat)
    call D_HELMHOLTZ_3D(f, bd_ax, bd_bx, bd_ay, bd_by, bd_az , bd_bz, xhandle, yhandle, ipar, dpar, stat)
    call free_Helmholtz_3D(xhandle, yhandle, ipar, stat)

    end subroutine solvePoisson3DVorticityPerMKL

The error :

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
CoupledSystem      0000000000519B15  Unknown               Unknown  Unknown
CoupledSystem      00000000005178D7  Unknown               Unknown  Unknown
CoupledSystem      00000000004CBB94  Unknown               Unknown  Unknown
CoupledSystem      00000000004CB9A6  Unknown               Unknown  Unknown
CoupledSystem      000000000047F4B6  Unknown               Unknown  Unknown
CoupledSystem      0000000000482AD0  Unknown               Unknown  Unknown
libpthread.so.0    00002B3F0728F130  Unknown               Unknown  Unknown
libmkl_def.so      00002B3F095743E4  Unknown               Unknown  Unknown
libmkl_core.so     00002B3F05D48E59  Unknown               Unknown  Unknown
libmkl_intel_ilp6  00002B3F0475F7CF  Unknown               Unknown  Unknown
CoupledSystem      0000000000447A77  vorticitysolverut         380  FluidUtilities.f90
CoupledSystem      00000000004579CC  vorticitysolverut        2596  FluidUtilities.f90
CoupledSystem      000000000045648F  vorticitysolverut        2567  FluidUtilities.f90
CoupledSystem      0000000000403865  MAIN__                    135  main.f90
CoupledSystem      00000000004030DE  Unknown               Unknown  Unknown
libc.so.6          00002B3F079D1AF5  Unknown               Unknown  Unknown
CoupledSystem      0000000000402FE9  Unknown               Unknown  Unknown

I have allocated the vectors previously. Again the code works without an issue on windows. Thanks. 

 

0 Kudos
2 Replies
Camilo_P_
Beginner
142 Views

I found the issue, I had an error in my makefile. I was not adding the flags when compiling the file that had the calls to the Helmoltz functions. 

 

cavaiola__mattia
Beginner
142 Views

Hi, I'm facing the same problem..

Can you explain how did you solve the problem and which flag have you added?

Reply