Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
221 Views

Floating divide by zero error in dfeast_scsrgv

Jump to solution
Hi,
 

I am using the FEAST eigenvalue solver to solve a generalized eigenvalue problem with symmetric sparse matrices in Fortran (Compiler: ifort 2020). I store the upper triangular parts of the matrices, i.e. set UPLO = 'U'.

Currently, I receive an error from ifort "forrtl: error (73): floating divide by zero", which is traced back to the dfeast_scsrgv call. I know that the matrices in the generalized eigenvalue problem may contain small values (i.e. values close to zero). So the sparse patterns might contain zero values. Could this be the cause of the error?

I have tried setting fpm(27) = 1 and fpm(28) = 1 to check input matrices, but this is not recognized by the dfeast_scsrgv call (it isn't listed in the output: List of input parameters fpm(1:64)-- if different from default). Is this a known issue?

Thank you,

Anna

0 Kudos

Accepted Solutions
Highlighted
Employee
106 Views

@Dalklint__Anna @Bernard 

We have identified the problem on our side (in MKL) and are working on a fix, so no further data is needed from @Dalklint__Anna. The issue is related to a rare case when two floating point numbers are exactly equal. So it can appear or disappear even when you just change a compiler or some round-off error accumulation.

The workaround could be to shift your mathematical problem somehow. I understand that this might not be possible. Maybe, say, one can try changing fpm(2), it will almost certainly shift the solution a bit.

Best,
Kirill

View solution in original post

0 Kudos
14 Replies
Highlighted
Moderator
212 Views

Anna, we are not aware of this problem. Could you give us a small test case that could build separately and reproduce the problem?



0 Kudos
Highlighted
Beginner
201 Views

I have tried to recreate a smaller example but the "division by zero" error does not appear.

I've also tried to run my program through a debugger to see if I can identify the cause of the error but without luck.  All variables I use in the call to dfeast_scsrgv are allocated and initiated.

Do you have any idea of what might cause the "Floating divide by zero" error to be thrown from dfeast_scsrgv?

0 Kudos
Highlighted
Moderator
197 Views

Did you check if the input data don't contain nan?


0 Kudos
Highlighted
Beginner
193 Views

Yes, I have checked all inputs to dfeast_scsrgv and they only contain valid numbers. The error might appear after a number of iterations have passed in the FEAST algorithm, or in the very first iteration.

The error only appears when I include the -fpe0 flag as compile option.

0 Kudos
Highlighted
Employee
183 Views

Hi Anna,

I suggest you try to create a reproducer in the following way.

First, before the call to dfeast_scsrgv you dump all input arguments (matrix, parameters, ...) into a file/files. Then you read them back into some new variables and call dfeast_scsrgv.
I assume you'll still see the floating point error.

Then you just move the part which reads the data into our example which uses dfeast_scsrgv and compile & link it the same way you do with your bigger application. I hope it will still fail.

Then (if success at every step) you just share with us the data and the modifed example and we check that the error can be reproduced on our side.

Best,
Kirill

 

0 Kudos
Highlighted
Beginner
179 Views

Hi again,

I include a test file (test.f90) which reads the sparse patterns from the files (.dat files in .zip) generated by my main program. When I run the problem it quits with the error "forrtl: error (73): floating divide by zero", so hopefully you will also see the same behavior. 

I compile it as follows:

ifort  -i8 -I${MKLROOT}/include/intel64/ilp64 -I${MKLROOT}/include -O0 -g -fpe0 -traceback -o test test.f90   ${MKLROOT}/lib/intel64/libmkl_blas95_ilp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl

and simply run it: ./test

0 Kudos
Highlighted
Employee
171 Views

Hi again,

1) Which version of MKL do you have?
2) What does ifort --version say?
3) What is the HW (at least the ISA, avx2, avx512 or ...)?
4) Do you see the floating point exception always or on a run-by-run basis?

Thanks,
Kirill

 

0 Kudos
Highlighted
Employee
167 Views

Hi again,

I've reprduced the issue on AVX2, MKL 2019, MKL 2020 and MKL 2020u2, with a couple of ifort versions for the test. We'll investigate and update once we have the analysis. With the latest oneMKL beta-10 the failure is not seen. Also not seen with MKL 2020u4.

@Gennady_F_Intel, could you open an internal ticket for us to investigate (it might be a lucky coincidence that we don't see it with the latest MKL versions)?

Best,
Kirill

0 Kudos
Highlighted
Moderator
163 Views

Anna, yesterday the new update of MKL v.2020 u4 has been released and available to download.

Please try this version and let us know if the problem is still there.


0 Kudos
Highlighted
Beginner
151 Views

Hi,

1) MKL version: imkl/2020.1.217

2) It says: ifort (IFORT) 19.1.1.217 20200306

3) The HPC uses "Intel Xeon processor E5-2650 v3", with "Intel® AVX2".

4) The floating point exception is always present for the previously attached program (test.f90). For my large program it is seen on a run-by-run basis.

Thanks,

Anna

0 Kudos
Highlighted
Beginner
139 Views

Hi again,

I tried the MKL v.2020 u4 version and then the error message vanishes.

0 Kudos
Highlighted
Beginner
137 Views

For my larger program the issue still remains however.

0 Kudos
Highlighted
Black Belt
112 Views

 

@Dalklint__Anna 

Have you tried to run your program under gdb and enable float-point exception handling?

You can use this command for catching floating-point exception by the gdb.

handle SIGFPE stop nopass.

 

0 Kudos
Highlighted
Employee
107 Views

@Dalklint__Anna @Bernard 

We have identified the problem on our side (in MKL) and are working on a fix, so no further data is needed from @Dalklint__Anna. The issue is related to a rare case when two floating point numbers are exactly equal. So it can appear or disappear even when you just change a compiler or some round-off error accumulation.

The workaround could be to shift your mathematical problem somehow. I understand that this might not be possible. Maybe, say, one can try changing fpm(2), it will almost certainly shift the solution a bit.

Best,
Kirill

View solution in original post

0 Kudos