Community
cancel
Showing results for 
Search instead for 
Did you mean: 
161 Views

Different computation results on different processors using mkl_cbwr_set(int)

  1. There are two desktop PC with the following processors:  Intel Core i5 4570 (Haswell) and Intel Core i5 3330 (Ivy Bridge).
  2. Use MKL 2019.0.1, build 20180928.
  3. The app use PARDISO with the following settings: MKL_INT _mtype = 11; MKL_INT _nrhs = 1; MKL_INT _iparm1 = 2; MKL_INT _iparm3 = 0; MKL_INT _iparm4 = 2; MKL_INT _iparm7 = -1; MKL_INT _iparm9 = 13; MKL_INT _iparm10 = 1; MKL_INT _iparm12 = 1; MKL_INT _iparm20 = 2; MKL_INT _iparm23 = 0; MKL_INT _iparm33 = 1; MKL_INT _iparm34 = 1; mkl_domain_set_num_threads(1, MKL_DOMAIN_PARDISO);
  4. Call the mkl_cbwr_set(MKL_CBWR_SSE2) and next PARDISO.
  5. The native library was build using Microsoft Visual Studio 2017 (v141)
  6. The mkl_intel_lp64.lib, mkl_intel_thread.lib, mkl_core.lib used as additional dependencies.
  7. The app runs on both PC.
  8. The calculation result is different. See attached files.

Please suggest a solution to my problem.

 

0 Kudos
13 Replies
Gennady_F_Intel
Moderator
161 Views

is that in-core mode?

161 Views

yes, in-core mode. _iparm[59] = 0.

Gennady_F_Intel
Moderator
161 Views

ok, then please take a look at the iparm(34), set the same #of threads for both cases and check if that will help to see the same output.

161 Views

Do you mean iparm(33)? - optimal number of OpenMP threads for conditional numerical reproducibility (CNR) mode. Now _iparm33 = 1 for both cases.

161 Views

Gennady,

I prepared the initial data files and the source files. JMatrix.csv is Jacobian, PowerUnbalance.csv is rhs vector. The software implementation you will find in PardisoProvider.cpp. You have to use

int Initialization(int n, int nrhs, Monitel::MathNative::Pardiso::Block2x2 * a, int * ja, int * ia, float *executionTime);

int Factorization(int n, Monitel::MathNative::Pardiso::Block2x2 * a, int * ja, int * ia, float *converterTime, float *factorizationTime, int PivotingPerturbation = 13);

and

int Solve(double * rhs, double * solution, float *executionTime);

in order to reproduce bug.

161 Views

I suppose we solved the problem. We added to

case DLL_PROCESS_ATTACH:

the next code:

#if defined (_WIN64)
        _set_FMA3_enable(0);
#endif

See also

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-fma3-enable-set-fma3-enable?vie....

 

Gennady_F_Intel
Moderator
161 Views

Renat, how could we build the sources you shared into post#6? 

161 Views

We use Microsoft Visual Studio 2017 (v.15.9.2). The platform toolset is v141. You have to add links to addational files in \include and \lib folders in order to use PardisoProvider::ConvertMatrix method. We use MKL static libraries (mkl_intel_lp64.lib
mkl_intel_thread.lib
mkl_core.lib), but you could use "Use Intel MKL" property for using MKL in the app. I have attached PerfCounter.h and PerfCounter.cpp also. It's necessary for PardisoProvider.cpp.

161 Views

Gennady,

did you manage to build a project?

Gennady_F_Intel
Moderator
161 Views

I couldn't build these project. There is not main function into sources you sent. Is that possible to simplify the case? reading from scv file into CSR format and calling pardiso...

161 Views

Ок, I'll prepare it.

161 Views

Gennady,


I have attached a simple project to reproduce the bug. It contains all necessary files. Please, run an executable file on Haswell and Ivy Bridge. The result will be in "result.csv".

Gennady_F_Intel
Moderator
161 Views

thanks, we will try this
Reply