- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm getting a crash in DSYEVR when I pass a non-identity 3x3 matrix (see below). I get no crash if I change compiler flags from '-O3 -static-intel -unroll -ftrapuv -automatic' to '-O0 -g' (and retain '-r4 -r8 -implicitnone -C -check nooutput_conversion -gen-interfaces -warn interfaces -traceback -fscomp logicals -align'). If I pass the identity 3x3 matrix with 'bad' flags, I get no crash.
forrtl: error (65): floating invalid
Image PC Routine Line Source
libmkl_lapack.dyl 000000010A8905A4 Unknown Unknown Unknown
libmkl_lapack.dyl 000000010A456804 Unknown Unknown Unknown
libmkl_lapack.dyl 000000010A4B0D99 Unknown Unknown Unknown
libmkl_lapack.dyl 000000010A4BB714 Unknown Unknown Unknown
libmkl_intel_thre 0000000100864647 Unknown Unknown Unknown
libmkl_intel_lp64 00000001005462F7 Unknown Unknown Unknown
a.opt 000000010000F044 _fib_dir_module_m 58 current_fib_dirs.f
a.opt 00000001000AC34F _intelmass_3d_ 447 IntElmAss_3D.f
a.opt 00000001000DFDE6 _solflowgmres_ 95 solflow.f
a.opt 000000010001BD13 _MAIN__ 515 driver.f
a.opt 0000000100000B6C Unknown Unknown Unknown
a.opt 0000000100000B04 Unknown Unknown Unknown
ifort --version
ifort (IFORT) 11.1 20100401
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
echo $MKLROOT
/opt/intel/Compiler/11.1/088/Frameworks/mkl
about this mac:
OSX version 10.5.8
2.93 GHz Quad-Core Intel Xeon
the call in question is this:
! SYEVR variables:
real*8 :: A(NSD,NSD) ! temp copy of B
real*8 :: Z(NSD,NSD) ! matrix of eigenvectors
character(len=1), parameter :: jobz = 'V' ! 'V' => compute evects
character(len=1), parameter :: range = 'A'! 'A' => compute all evals
character(len=1), parameter :: uplo = 'U' ! see usage below
integer, parameter :: lwork = 26*NSD ! size of work array
integer, parameter :: liwork = 10*NSD ! size of iwork array
real*8 work(lwork) ! workspace array
integer iwork(liwork) ! workspace array
integer info ! error code
integer m, isuppz(2*NSD) ! see usage below
real*8 vl, vu
integer il, iu
FAILING compile options are this:
mac_desktop_opt_FCFLAGS =\\WORKING compile options:
mac_desktop_valgrind_FCFLAGS =\\when i tested with ifort v 11.1.058, the crash would occur in random weird places. with 11.1.088 it seems to crash consistently in the spot i quoted above.
any ideas?
i have also done testing on ifort v 11.1.069 on linux using valgrind.and then my process terminates with SIGSEGV.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Specifically, you declare A(NSD,NSD), with NSD=26, but only use the leading 3 X 3 submatrix.
The fourth argument in the call to DSYEVR should be the actual size of A, not the declared size of A, and the latter is already being passed as 'lda', the sixth argument. Since only the 3 X 3 part (9 elements) have been assigned values, the remaining (26 X 26 - 9) elements are undefined and, with -ftrapuv selected, you will get an abort for using undefined variables. That makes -ftrapuv actually a "good" option, unless you want to hide errors!
Not realizing the real error, you have been trying out various ways to cure the problem. The simple fix is to pass the correct fourth argument as follows:
integer :: n
..
n = 3
..
call DSYEVR(
..
..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried a few combinations of other compiler switches, but with no change in the results. Please show an example where DSYEVR gives incorrect results, or report a combination of compiler switches for which my example fails. We can take it from there.
[fxfortran] program nooj implicit none integer, parameter :: NSD=3 ! SYEVR variables: real*8 :: A(NSD,NSD) ! temp copy of B real*8 :: Z(NSD,NSD) ! matrix of eigenvectors character(len=1), parameter :: jobz = 'V' ! 'V' => compute evects character(len=1), parameter :: range = 'A'! 'A' => compute all evals character(len=1), parameter :: uplo = 'U' ! see usage below integer, parameter :: lwork = 26*NSD ! size of work array integer, parameter :: liwork = 10*NSD ! size of iwork array real*8 work(lwork) ! workspace array integer iwork(liwork) ! workspace array integer info ! error code integer m, isuppz(2*NSD) ! see usage below real*8 vl, vu, evalues(NSD) integer il, iu, i,j data A/4d0,3*-1d0,4d0,3*-1d0,4d0/ call DSYEVR( & jobz, ! intent(in): jobz; V => compute eigenvectors & range, ! intent(in): range; A => compute all eigs & uplo, ! intent(in): uplo; which triangle holds elems of A & NSD, ! intent(in): n; size of A & A, ! intent(inout): input array, non-uplo triangle overwritten & NSD, ! intent(in): lda & vl,vu, ! intent(in): vl,vu; not referenced (since range='A') & il,iu, ! intent(in): il,iu; not referenced (since range='A') & 0d+0, ! intent(in): abstol; 0 => use default min tolerance & m, ! intent(out): num eigenvalues found & evalues,! intent(out): eigenvalues are put here & Z, ! intent(out): eigenvectors are put here & NSD, ! intent(in): ldz; first dimen of z & isuppz, ! intent(out): indices of support of eigenvects in z & work, ! intent(out): workspace array & lwork, ! intent(in): dimension of work array, >= 26*n & iwork, ! intent(out): workspace array & liwork, ! intent(in): dimension of iwork array, >= 10*n & info ! intent(out): error code &) if(info.eq.0)then write(*,*)' Eigenvalues : ' write(*,10)evalues(1:3) write(*,*)' Eigenvectors : ' write(*,20)((Z(i,j),j=1,3),i=1,3) else write(*,*)' Info = ',info endif 10 format(1x,3G14.4) 20 format(1x,3G14.4) end program nooj[/fxfortran]RESULTS:
[bash]~/LANG> ifort -mkl -r8 -i4 -implicitnone -C -check nooutput_conversion -traceback -fpscomp logicals -align -O3 -static-intel -unroll -ftrapuv -automatic nooj.f ~/LANG> ./a.out Eigenvalues : 2.000 5.000 5.000 Eigenvectors : -0.5774 -0.4082 0.7071 -0.5774 -0.4082 -0.7071 -0.5774 0.8165 0.000 [/bash]
Some of the switches that you have chosen are contradictory -- for example, -C and -O3. There has to be some reason why you chose them, but I cannot guess it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page