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

DGESV gives different results on subsequent runs

dread__am
Beginner
821 Views

Hi,

I got a 181x181 system matrix AA and a 181x1 right hand side bb. In my test program (please see attachment) I solve this equation

system twice and I get two slightly different results. Are there any explanations for this ?

The test was carried out on Windows 10 and I used VS 2017 Version 19.13.26131.1  x86.

To compile and link please use:

cl /Fodgesv_test.obj /c dgesv_test.cpp /EHsc /IC:\<path to MKL headers>

link /nologo /OUT:dgesv_test.exe /LIBPATH:C:\<path to MKL libraries> mkl_intel_c.lib mkl_sequential.lib mkl_core.lib dgesv_test.obj

Then simply run dgesv_test.exe.

Any help is appreciated.

Regards

0 Kudos
1 Solution
Gennady_F_Intel
Moderator
821 Views

That's might be the problem. Please try to set MKL_CBWR= SSE4_2/AVX/AVX2/AVX512 and check if the problem will still exist.

 

View solution in original post

0 Kudos
7 Replies
dread__am
Beginner
821 Views

I forgot to mention the MKL version in my previous post.

I am using version 2020.0.166

0 Kudos
dread__am
Beginner
821 Views

I forgot to mention the MKL version I am using in my previous post.

I am using MKL version 2020.0.166

0 Kudos
mecej4
Honored Contributor III
821 Views

When I compile for x64 and run, I don't see any differences. The vector diff has all zero valued elements. I changed the program to output diff_sum instead of diff, and I get

Info:0
Info:0
Difference:0

When I compile for x86, I see

Info:0
Info:0
Difference:2.03139e-06

 

0 Kudos
Gennady_F_Intel
Moderator
822 Views

That's might be the problem. Please try to set MKL_CBWR= SSE4_2/AVX/AVX2/AVX512 and check if the problem will still exist.

 

0 Kudos
dread__am
Beginner
821 Views

Thanks...this helped.

I used

int my_cbwr_branch = mkl_cbwr_get_auto_branch();
if (mkl_cbwr_set(my_cbwr_branch))
{
     printf("Error in setting MKL_CBWR_BRANCH! Aborting…\n”);
     return -1;
}

at the beginning of my program and now diff_sum is zero.

0 Kudos
Gennady_F_Intel
Moderator
821 Views

CNR model affects performance. if the level of degradation will be significant, please report this case.

0 Kudos
dread__am
Beginner
821 Views

Ok...thanks. As far as I can see there is no performance impact for the cases I am analyzing.

0 Kudos
Reply