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

Strange bad memory of MKL spline function

lucyhua_zhang2003
1,561 Views

Dear all,

I am using MKL compilers_and_libraries_2017.4.210 (update 3) and following the developer guide to construct a cubic spline interpolation workflow. However no matter how I configure my inputs the scoeff values from dfdEditPPSpline1D() output stays bad memory allocation. The function return a good status but then crashes in the next function dfdConstruct1D(). I wonder whether I miss something in my configuration or inclusion of files, or whether there is a bug. My source code was copied below with dummy input data.

Regards,

Tianhua

--------------------------------------------

For compile, I included 34 h files that are enough for my project.

For link I included mkl_core.lib, mkl_core_dll.lib, mkl_intel_ilp64.lib, mkl_intel_ilp64_dll.lib, mkl_sequential.lib and mkl_sequential_dll.lib.

For execution, I included mkl_core.dll, mkl_sequential.dll and mkl_vml_def.dll

Those appear enough.

Dummy source code which has bad memory of scoeff pointer and crashes in the next function.

------{

//setup MKL data structures

#define SPLINE_ORDER DF_PP_CUBIC /* A cubic spline to construct */

int status; /* Status of a Data Fitting operation */

DFTaskPtr task; /* Data Fitting operations are task based */

/* Parameters describing the partition */

MKL_INT nx; /* The size of partition x */

MKL_INT xhint; /* Additional information about the structure of breakpoints */

/* Parameters describing the function */

MKL_INT ny; /* Function dimension */

MKL_INT yhint; /* Additional information about the function */

/* Parameters describing the spline */

MKL_INT s_order; /* Spline order */

MKL_INT s_type; /* Spline type */

MKL_INT ic_type; /* Type of internal conditions */

double* ic; /* Array of internal conditions */

MKL_INT bc_type; /* Type of boundary conditions */

double* bc; /* Array of boundary conditions */

double scoeff[(20 - 1)* SPLINE_ORDER]; /* Array of spline coefficients */

MKL_INT scoeffhint; /* Additional information about the coefficients */

MKL_INT sitehint; /* Additional information about the structure of

interpolation sites */

MKL_INT ndorder, dorder; /* Parameters defining the type of interpolation */

double* datahint; /* Additional information on partition and interpolation sites */

double *r; /* Array of interpolation results */

r = new double[20];

MKL_INT rhint; /* Additional information on the structure of the results */

MKL_INT* cell; /* Array of cell indices */

/* Initialize the partition */

nx = 10;

nsite = 20;

double x[10], y[10];

for (int i = 0; i < 10; i++)

{

x = i;

y = pow(i, 3);

}

for (int i = 0; i < 20; i++)

{

site = i;

}

for (int i = 0; i < 19 * SPLINE_ORDER; i++)

scoeff = -9999.0;

xhint = DF_NON_UNIFORM_PARTITION; /* The partition is non-uniform. */

/* Initialize the function */

ny = 1; /* The function is scalar. */

yhint = DF_NO_HINT; /* No additional information about the function is provided. */

status = dfdNewTask1D(&task, nx, x, xhint, ny, y, yhint);

if (status == 0)

{

/* Initialize spline parameters */

s_order = DF_PP_CUBIC; /* Spline is of the fourth order (cubic spline). */

s_type = DF_PP_NATURAL; /* Spline is of the natural cubic spline type. */

/* Define internal conditions for cubic spline construction (none in this example) */

ic_type = DF_NO_IC;

ic = NULL;

/* Use not-a-knot boundary conditions. In this case, the is first and the last

interior breakpoints are inactive, no additional values are provided. */

bc_type = DF_BC_FREE_END; //natural cubic spline

bc = NULL;

scoeffhint = DF_NO_HINT; /* No additional information about the spline. */

status = dfdEditPPSpline1D(task, s_order, s_type, bc_type, 0, ic_type,

0, &scoeff[0], scoeffhint);

//continue only when the internal boundary condition task is successful

if (status == 0)

{

/* Use a standard method to construct a cubic Bessel spline: */

/* Pi(x) = ci,0 + ci,1(x - xi) + ci,2(x - xi)2 + ci,3(x - xi)3, */

/* The library packs spline coefficients to array scoeff: */

/* scoeff[4*i+0] = ci,0, scoef[4*i+1] = ci,1, */

/* scoeff[4*i+2] = ci,2, scoef[4*i+1] = ci,3, */

/* i=0,...,N-2 */

status = dfdConstruct1D(task, DF_PP_SPLINE, DF_METHOD_STD);

// skip the data construction check, TZ May 2017

sitehint = DF_NON_UNIFORM_PARTITION; /* Partition of sites is non-uniform */

ndorder = 1;

dorder = 1;

datahint = DF_NO_APRIORI_INFO; /* No additional information about breakpoints or

sites is provided. */

rhint = DF_MATRIX_STORAGE_ROWS; /* The library packs interpolation results

in row-major format. */

cell = NULL; /* Cell indices are not required. */

/* Solve interpolation problem using the default method: compute the spline values

at the points site(i), i=0,..., nsite-1 and place the results to array r */

status = dfdInterpolate1D(task, DF_INTERP, DF_METHOD_PP, nsite, site,

sitehint, ndorder, &dorder, datahint, r, rhint, cell);

/* De-allocate Data Fitting task resources */

status = dfDeleteTask(&task);

}

--------------------

 

 

 

 

0 Kudos
21 Replies
Gennady_F_Intel
Moderator
1,423 Views

Tianhua, do you really need to link with ilp64 libs?  

Could you check how the case will work w/ lp64?  and please have a look at the MKL Linker Adviser to choose the recommended list of MKL's libraries ( https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor)!

 In the case if you really need to use ILP64, then don't forget to add compiler option - /DMKL_ILP64 

thanks, Gennady

0 Kudos
Tianhua_Z_
Beginner
1,423 Views

Hi Gennady,

Thanks for the response.

Still no luck. I double checked and I do need ilp64 lib.

I am using MS Visual Studio 2015 and I added  /DMKL_ILP64 -I"%MyPathThirdParty%"\include and no changes. The bad memory and later on crash remains the same.

Regards,

Tianhua

0 Kudos
Egor_F_Intel
Employee
1,423 Views

Hello Tianhua,

 

Per our analysis of your test case, we suggest to address several aspects in the code:

  1. Allocate memory for the array of interpolation sites ‘site’. You can allocate the memory using this code:

                    site = new double[20];

  2. Modify the dimension of an array of spline coefficients ‘scoeff’ and set it to (NX - 1) * SPLINE_ORDER, where NX is the size of the partition x.

    NX = 10 in the code you have provided.

 

I attach the modified test case.

Can you please run the attached code and report about the results on your side?

Can you also provide details about OS and CPU you use? This will help us better investigate your issue.

 

On dfdEditPPSpline1D() function: this function does not perform the computations, it just registers the pointers to memory buffers  you provided for spline coefficients, boundary and internal conditions, in the Data Fitting task.

Thus, it is okay to see that values in the ‘scoeff’ array are not modified after the call to dfdEditPPSpline1D() function.

The function dfdConstruct1D() run actual computations and modifies ‘scoeff’ array.

 

Thanks, Egor

 

//setup MKL data structures
#include <stddef.h>
#define SPLINE_ORDER DF_PP_CUBIC /* A cubic spline to construct */
#define NX      10
#define NSITE   20

void main()
{
    int status;         /* Status of a Data Fitting operation */

    DFTaskPtr task;     /* Data Fitting operations are task based */

    /* Parameters describing the partition */
    MKL_INT nx;         /* The size of partition x */
    MKL_INT xhint;      /* Additional information about the structure of breakpoints */

    /* Parameters describing the function */
    MKL_INT ny;         /* Function dimension */
    MKL_INT yhint;      /* Additional information about the function */

    /* Parameters describing the spline */
    MKL_INT s_order;    /* Spline order */
    MKL_INT s_type;     /* Spline type */
    MKL_INT ic_type;    /* Type of internal conditions */
    double* ic;         /* Array of internal conditions */
    MKL_INT bc_type;    /* Type of boundary conditions */
    double* bc;         /* Array of boundary conditions */
    double scoeff[(NX - 1) * SPLINE_ORDER];  /* Array of spline coefficients */
    MKL_INT scoeffhint; /* Additional information about the coefficients */

    /* Parameters describing the interpolation sites */
    double* site;               /* Array of interpolation sites */
    site = new double[NSITE];
    MKL_INT sitehint;           /* Additional information about the structure of interpolation sites */
    MKL_INT ndorder, dorder;    /* Parameters defining the type of interpolation */
    double* datahint;           /* Additional information on partition and interpolation sites */

    /* Parameters describing the interpolation results */
    double* r = NULL;           /* Array of interpolation results */
    r = new double[NSITE];
    MKL_INT rhint;              /* Additional information on the structure of the results */
    MKL_INT* cell;              /* Array of cell indices */

    /* Initialize the partition */
    nx = NX;
    nsite = NSITE;
    double x[NX], y[NX];
    for (int i = 0; i < nx; i++)
    {
        x = i;
        y = pow(i, 3);
    }
    for (int i = 0; i < NSITE; i++)
    {
        site = i;
    }
    for (int i = 0; i < (nx - 1) * SPLINE_ORDER; i++)
    {
        scoeff = -9999.0;
    }

    xhint = DF_NON_UNIFORM_PARTITION; /* The partition is non-uniform. */

    /* Initialize the function */
    ny = 1;             /* The function is scalar. */
    yhint = DF_NO_HINT; /* No additional information about the function is provided. */

    status = dfdNewTask1D(&task, nx, x, xhint, ny, y, yhint);
    if (status == 0)
    {
        /* Initialize spline parameters */
        s_order = DF_PP_CUBIC;      /* Spline is of the fourth order (cubic spline). */
        s_type  = DF_PP_NATURAL;    /* Spline is of the natural cubic spline type. */

        /* Define internal conditions for cubic spline construction (none in this example) */
        ic_type = DF_NO_IC;
        ic = NULL;

        /* Use free-end boundary conditions. */
        bc_type = DF_BC_FREE_END; //natural cubic spline
        bc = NULL;
        scoeffhint = DF_NO_HINT; /* No additional information about the spline. */

        status = dfdEditPPSpline1D(task, s_order, s_type, bc_type, 0, ic_type, 0, scoeff, scoeffhint);

        //continue only when the internal boundary condition task is successful
        if (status == 0)
        {
            /* Use a standard method to construct a cubic Bessel spline: */
            /* Pi(x) = ci,0 + ci,1(x - xi) + ci,2(x - xi)2 + ci,3(x - xi)3, */
            /* The library packs spline coefficients to array scoeff: */
            /* scoeff[4*i+0] = ci,0, scoef[4*i+1] = ci,1, */
            /* scoeff[4*i+2] = ci,2, scoef[4*i+1] = ci,3, */
            /* i=0,...,N-2 */

            status = dfdConstruct1D(task, DF_PP_SPLINE, DF_METHOD_STD);
            // skip the data construction check, TZ May 2017
            if (status != 0)
            {
                // Error in spline construction
            }

            sitehint = DF_NON_UNIFORM_PARTITION; /* Partition of sites is non-uniform */

            ndorder = 1;
            dorder = 1;

            datahint = DF_NO_APRIORI_INFO;      /* No additional information about breakpoints or sites is provided. */
            rhint    = DF_MATRIX_STORAGE_ROWS;  /* The library packs interpolation results in row-major format. */
            cell     = NULL;                    /* Cell indices are not required. */

            /* Solve interpolation problem using the default method: compute the spline values
               at the points site(i), i=0,..., nsite-1 and place the results to array r */

            status = dfdInterpolate1D(task, DF_INTERP, DF_METHOD_PP, nsite, site, sitehint, ndorder, &dorder, datahint, r, rhint, cell);
            if (status != 0)
            {
                // Error in spline-based interpolation
            }

            /* De-allocate Data Fitting task resources */
            status = dfDeleteTask(&task);
        }
    }
}

 

0 Kudos
Tianhua_Z_
Beginner
1,423 Views

Hello Egor,

I merged the changes as above and the crash remains.

1) The memory allocation of site[] was done before. I just forgot to copy it. Otherwise it should crash much earlier. The dummy code was imbedded in my private code and I did not separate them cleanly

2) The include of <stddef.h>, adjustment of array dimension did not work. I still crash at the same place, i.e. at dfdConstruct1D() function. The only strange thing I can see is that scoeff has invalid memory. The others are sealed inside in dfdConstruct1D() and I have no idea why it crashes. Maybe you know more

3) I am using Dell laptop with processor Intel(R) Core(TM) i7-4930MX CPU @3.00GHz and 3.2GHz. Windows 7 Enterprise SP1 64-bit operating system with company package. Also I develop on top of Ocean for Techlog 64-bit APIs -- this is only to say that I need to compile and run on 64-bit Release system of Visual Studio C++. I included Intel MKL libs as third party inclusion with the 3 libs mentioned as well as 3 dlls in the execution directory

Hope this helps.

Thank for your help and best regards,

Tianhua

0 Kudos
VictoriyaS_F_Intel
1,423 Views

Hi Tianhua,

Would you be able help us reproduce the crash on our side by creating and sharing with us a standalone test case (probably, VS project)?

If it is not possible, can you share as many details on the configuration of the project including compiler flags, linkage settings and the version of Visual Studio?

Best regards,

Victoriya

0 Kudos
Tianhua_Z_
Beginner
1,423 Views

Hi Victoriya,

It is a good idea to reproduce the crash.

1) You have all the source code. So I believe it should be easy for your side to build a standalone C++ Win64 project and see whether the crash happens or not. It is public, the source code as well standalone Visual Studio C++ project creation

2) There is a second possibility that I am developing on Ocean For Techlog SDK platform, which it is not public and I believe you cannot test on your own without me going through some confidentiality checking. So what I did was: I created a "standalone" project on top of this SDK layer (to remove my private project source code just in case memory issue coming from somewhere else). With this "standalone" project I have basic SDK environment and the above public MKL Spline functionality. And the crash and bad memory of scoeff remains the same.

So what I propose is: you do a standalone public C++ test to see whether you can run through the above public code or not.

--If you succeed in running, then the issue comes from the incompatibility between our SDK layer and your libraries. Then I and you probably need to go through some company formality in order to continue.

--However if you can reproduce the crash even with the public code as well as standard VS project, it means your libraries have something need to be considered

At the same time, I have a tight development time, I already found new source code from Numerical Recipies of cubic spline and implemented them.

Let me know if you have found something with standard VS C++ project.

Best regards,

Tianhua

0 Kudos
Egor_F_Intel
Employee
1,423 Views

Hi Tianhua,

 

I integrated Intel MKL 2017 Update 3 into MSVS* 2015 and built a standalone C++ Win64 project using the test-case provided earlier, and ILP64 mode and dynamic sequential library of Intel MKL. The crash is not reproduced.

I attach the project. Please, run it on your computer and let us know results.551849

 

This is result Build Command Line:

cl /c /Zi /W3 /WX- /sdl- /O2 /Oi /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"x64\Release\\" /Fd"x64\Release\vc140.pdb" /Gd /TP /errorReport:prompt /D MKL_ILP64 main.cpp

This is Link Command Line:

"/OUT:c:\users\documents\visual studio 2015\Projects\mkl_df_issue\x64\Release\mkl_df_issue.exe" /VERBOSE /LIBPATH:Z:\MKL\__release_win\mkl\lib\intel64_win /LTCG:STATUS mkl_core.lib mkl_core_dll.lib mkl_intel_ilp64.lib mkl_intel_ilp64_dll.lib mkl_sequential.lib mkl_sequential_dll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG "/PDB:c:\users\documents\visual studio 2015\Projects\mkl_df_issue\x64\Release\mkl_df_issue.pdb" /OPT:REF /OPT:ICF /LTCG:incremental /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:c:\users\documents\visual studio 2015\Projects\mkl_df_issue\x64\Release\mkl_df_issue.lib" /MACHINE:X64 x64\Release\main.obj

 

0 Kudos
Tianhua_Z_
Beginner
1,423 Views

Hi EGOR,

Thanks for the solution. Sorry it took me a bit of time to get some free time.

I downloaded the solution and recompiled and run on VS2015. The crash is the same as before. The scoeff is invalid as before.

I am using the library which will automatically installed to

Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\...

Not sure whether this helps or not.

I am using VS Build menu, not the command line. However I can see the Command Line setting for C/C++ as following:

/GS /GL /W3 /Gy /Zc:wchar_t /I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\mkl\include" /Zi /Gm- /Od /sdl- /Fd"x64\Release\vc140.pdb" /Zc:inline /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /Gd /Oi /MD /Fa"x64\Release\" /EHsc /Fo"x64\Release\" /Fp"x64\Release\mkl_df_issue.pch" /D MKL_ILP64

Linker command line

/OUT:"D:\NGI\slim_NGI\testMKL\mkl_df_issue\mkl_df_issue\x64\Release\mkl_df_issue.exe" /MANIFEST /LTCG:incremental /NXCOMPAT /PDB:"D:\NGI\slim_NGI\testMKL\mkl_df_issue\mkl_df_issue\x64\Release\mkl_df_issue.pdb" /DYNAMICBASE "mkl_core.lib" "mkl_core_dll.lib" "mkl_intel_ilp64.lib" "mkl_intel_ilp64_dll.lib" "mkl_sequential.lib" "mkl_sequential_dll.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /LTCG:STATUS /MACHINE:X64 /OPT:REF /PGD:"D:\NGI\slim_NGI\testMKL\mkl_df_issue\mkl_df_issue\x64\Release\mkl_df_issue.pgd" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Release\mkl_df_issue.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /VERBOSE /LIBPATH:"Z:\MKL\20170505\__release_win\redist\intel64_win\mkl" /LIBPATH:"Z:\MKL\20170505\__release_win\mkl\lib\intel64_win" /LIBPATH:"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\redist\intel64_win\mkl" /LIBPATH:"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\mkl\lib\intel64_win" /TLBID:1

 

regards,,

Tianhua

0 Kudos
Egor_F_Intel
Employee
1,423 Views

Hi Tianhua,

 

Can I ask you to run another experiment with your test case by providing the required Intel MKL libraries, static or dynamic, not both to the linkage line

Please, use Intel MKL link advisor  https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor to choose required configuration.

 

Also, can you please clarify what output did you observe with your latest test case? Say, it is a seg fault, wrong computation results or something else?

 

Best regards,

Egor

0 Kudos
Tianhua_Z_
Beginner
1,423 Views

Hi Egor,

Attached is the advisor result screen snapshot in MKLAdvisor.jpg. I put this setting in VS project as is shown in VSProjectSetting,jpg.

The project is Release x64.

The execution terminated without going to the next line at function

status = dfdConstruct1D(task, DF_PP_SPLINE, DF_METHOD_STD);

I did a debug point and follow the execution step by step. It reached this line, then exit. The Output information after the exit is below:

'mkl_df_issue.exe' (Win32): Loaded 'D:\NGI\slim_NGI\testMKL\mkl_df_issue\mkl_df_issue\x64\Release\mkl_df_issue.exe'. Symbols loaded.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'D:\NGI\slim_NGI\testMKL\mkl_df_issue\mkl_df_issue\x64\Release\mkl_sequential.dll'. Module was built without symbols.

'mkl_df_issue.exe' (Win32): Loaded 'D:\NGI\slim_NGI\testMKL\mkl_df_issue\mkl_df_issue\x64\Release\mkl_core.dll'. Module was built without symbols.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-runtime-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-timezone-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-file-l2-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-localization-l1-2-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-synch-l1-2-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-processthreads-l1-1-1.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-file-l1-2-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-string-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-heap-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-stdio-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-convert-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-math-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-locale-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-time-l1-1-0.dll'. Cannot find or open the PDB file.

'mkl_df_issue.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-filesystem-l1-1-0.dll'. Cannot find or open the PDB file.

The program '[5144] mkl_df_issue.exe' has exited with code 2 (0x2).

Best regards,

Tianhua

 

0 Kudos
Gennady_F_Intel
Moderator
1,422 Views

I checked how this example works from command line. MKL 2017 u3, Win64 ( dynamic and/or static), LP64/ILP64 cases. The problem has not been reproduced on SSE4,2, AVX and AVX2   processors. all works fine. the logs are attached.

0 Kudos
Tianhua_Z_
Beginner
1,422 Views

Sorry but I did not find the attached logs. Any link?

Tianhua

0 Kudos
Gennady_F_Intel
Moderator
1,422 Views

I attached outputs for AVX, SSE42 and AVX2 based system. windows 8.1, 64 bit, static link. the similar results were obtained with dynamic linking mode too. 

 

0 Kudos
Tianhua_Z_
Beginner
1,422 Views

Gennady,

For any reason, I do NOT see any attachment of the outputs.

Regards,

Tianhua

0 Kudos
Tianhua_Z_
Beginner
1,422 Views

Gennady,

At the same time, please find attached the standalone project I am using to demonstrate the crash. You may need to change VS 2015 C/C++ include directories for the .h files locations as well as Link/General for the lib directories.

It should be able to be compiled and run in VS2015 in Windows as long as those folders are properly pointed to. To run the project, I used IDE run (the green triangle on IDE). Also you need to put mkl_core.dll, mkl_dequential.dll and mkl_vml_def.dll in solution/x64/Release folder where the mkl_df_issue.exe is generated.

See whether you can reproduce my crash or not.

Regards,

Tianhua

0 Kudos
Gennady_F_Intel
Moderator
1,422 Views

Hello Tianhua,

Here is output I see on my side undere VS 2015 IDE. Windows 8.1, 64 bit, ILP64 mode, threading.

Major version:           2017

Minor version:           0
Update version:          3
Product status:          Product
Build:                   20170413
Platform:                Intel(R) 64 architecture
Processor optimization:  Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) e
nabled processors
================================================================

scoeff[0] = 0.000000
scoeff[1] = 0.000222
scoeff[2] = 0.000000
scoeff[3] = 0.999778
scoeff[4] = 1.000000
scoeff[5] = 2.999556
scoeff[6] = 2.999334
scoeff[7] = 1.001110
scoeff[8] = 8.000000
scoeff[9] = 12.001554
scoeff[10] = 6.002664
scoeff[11] = 0.995782
scoeff[12] = 27.000000
scoeff[13] = 26.994229
scoeff[14] = 8.990011
scoeff[15] = 1.015760
scoeff[16] = 64.000000
scoeff[17] = 48.021532
scoeff[18] = 12.037292
scoeff[19] = 0.941176
scoeff[20] = 125.000000
scoeff[21] = 74.919645
scoeff[22] = 14.860821
scoeff[23] = 1.219534
scoeff[24] = 216.000000
scoeff[25] = 108.299889
scoeff[26] = 18.519423
scoeff[27] = 0.180688
scoeff[28] = 343.000000
scoeff[29] = 145.880799
scoeff[30] = 19.061487
scoeff[31] = 4.057714
scoeff[32] = 512.000000
scoeff[33] = 196.176915
scoeff[34] = 31.234628
scoeff[35] = -10.411543

thanks, Gennady

0 Kudos
Tianhua_Z_
Beginner
1,422 Views

HI Gennady,

thanks for the response. It is interesting -- on my side the scoeff values are -9999 (missing values by our definition).

I attached my project settings that I think matters. Could you share the same screen snapshots so that I can compare? Did you do any special adjustment from default VS settings (besides the file paths)?

Regards,

Tianhua

0 Kudos
Gennady_F_Intel
Moderator
1,422 Views

Hi Tianhua,

I changed two things into this solution: 1/ I used Intel Compiler because of I have no install  (Platform Toolset = 'v140') cannot be found...

and the 2/  you linked with mkl_core.lib all of these libs "mkl_core_dll.lib mkl_intel_ilp64.lib mkl_intel_ilp64_dll.lib mkl_sequential.lib mkl_sequential_dll.lib"  This is not correct. I left only static libs or dynamic ( the results are the same).

attached two screenshots for debug and release 64 bit outputs.

hope this helps. 

0 Kudos
Tianhua_Z_
Beginner
1,422 Views

Hi Gennady,

This advances a lot -- I removed all the xxx_dll.libs and the solution works. I did another test by removing all the static libs and leave only the xxx_dll.lib and it does NOT work.

In this case it looks to me there is something wrong in the xxx_dll.libs. I wonder why they are in the distribution package and when to use them? Is there really a bug in them?

Any way, thank you and all the rest technical team members who were involved in this issue analysis. The solution is NOT to use the xxx_dll.libs and only use the static ones.

Best regards,

Tianhua

0 Kudos
Gennady_F_Intel
Moderator
1,298 Views

static libs work - perfect, but what do you mean by "... it does NOT work" - hanging, wrong results, exceptions? We see no problems with dynamic libraries also on our side. 

0 Kudos
Reply