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

MKL summary statistics error

I try to compute the mean of an array by the summary statistics function,  I am following the link

https://software.intel.com/en-us/articles/overview-of-summary-statistics-ss-in-intel-mkl-v103

However. after I compile it and run it, then it will have Segmentation fault (core dumped) error.

Here is my code:

   int N     = 4;

    VSLSSTaskPtr task; /* SS task descriptor */
    double x; /* Array for dataset */
    double mean; /* Array for mean estimate */
    double* w = 0; /* Null pointer to array of weights, default weight equal to one will be used in the computation */
    MKL_INT p, n, xstorage;
    int status;
    x[0] = 0.1;
    x[1] = 0.2;
    x[2] = 0.3;
    x[3] = 0.4;
    /* Initialize variables used in the computation of mean */
    p = 1;
    n = N;
    xstorage = VSL_SS_MATRIX_STORAGE_ROWS;
    mean = 0.0;
   
    /* Step 1 - Create task */
    status = vsldSSNewTask( &task, &p, &n, &xstorage, x, w, 0 );

    /* Step 2- Initialize task parameters */
    status = vsldSSEditTask( task, VSL_SS_ED_MEAN, &mean );

    /* Step 3 - Compute the mean estimate using SS one-pass method */
    status = vsldSSCompute(task, VSL_SS_MEAN, VSL_SS_METHOD_1PASS );

    /* Step 4 - deallocate task resources */
    status = vslSSDeleteTask( &task );

 

Almost the same as the example in the link. I don't know what is the problem, is it because i misunderstand the function?

 

0 Kudos
3 Replies
Highlighted
Beginner
46 Views

When I use the example to check the error information, then I have

VSL_SS_ERROR_STORAGE_NOT_SUPPORTED.

I changed the format based on the reference, actually, there are only two kinds of storage format and neither of them does work. Could any one help me solve it? thanks before hand.

0 Kudos
Highlighted
Employee
46 Views

Hi Jun,

Can you please clarify the version of Intel MKL and cpu you use in your experiments? Also, additional details on type of linkage and the version, 32- or 64 bit of the library would be helpful.

Thanks,

Andrey

0 Kudos
Highlighted
Beginner
46 Views

Andrey N. (Intel) wrote:

Hi Jun,

Can you please clarify the version of Intel MKL and cpu you use in your experiments? Also, additional details on type of linkage and the version, 32- or 64 bit of the library would be helpful.

Thanks,

Andrey

 

Hi, Andrey,

Thanks for your reply, I figured out the problem that I miss some parts in the makefile of my code. After fixed it, it works.

0 Kudos