Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7261 讨论

Floating divide by zero error in dfeast_scsrgv

Dalklint__Anna
初学者
5,117 次查看
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 项奖励
1 解答
Kirill_V_Intel
5,002 次查看

@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

在原帖中查看解决方案

0 项奖励
16 回复数
Gennady_F_Intel
主持人
5,108 次查看

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 项奖励
Dalklint__Anna
初学者
5,097 次查看

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 项奖励
Gennady_F_Intel
主持人
5,093 次查看

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


0 项奖励
Dalklint__Anna
初学者
5,089 次查看

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 项奖励
Kirill_V_Intel
5,079 次查看

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 项奖励
Dalklint__Anna
初学者
5,075 次查看

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 项奖励
Kirill_V_Intel
5,067 次查看

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 项奖励
Kirill_V_Intel
5,063 次查看

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 项奖励
Dalklint__Anna
初学者
5,047 次查看

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 项奖励
Gennady_F_Intel
主持人
5,059 次查看

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 项奖励
Dalklint__Anna
初学者
5,035 次查看

Hi again,

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

0 项奖励
Dalklint__Anna
初学者
5,033 次查看

For my larger program the issue still remains however.

0 项奖励
Bernard
重要分销商 I
5,008 次查看

 

@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 项奖励
Kirill_V_Intel
5,003 次查看

@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

0 项奖励
Gennady_F_Intel
主持人
4,680 次查看

some fix has been added to the latest version of ove mkl 2021.2which available to download


0 项奖励
Gennady_F_Intel
主持人
4,626 次查看

The issue is closing and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


0 项奖励
回复