Quantcast
Channel:
Viewing all articles
Browse latest Browse all 21

Thank you all.

$
0
0

Thank you all.

Sergey:

The correct way for deallocating arrays is with

delete [] d;

Nevertheless, I did try your idea without success.

You were right, there was a typo.

double *a = new double[n * n];

As far as I know, MKL accepts matrices in 1D storage (column or row-major), so there is no need to create 2D arrays.

Mecej4: The corrected with brackets initialization creates an 1D arrays with nxn elements which should be sufficients.

You were right that elements were not initialized but even if I do:

    double *a = new double[n * n];
    for(IntType i = 0; i < n * n; ++i)
    {
        a[i] = 0.;
    }

... there is no success. Personally, I believe that even unitialized the routine should not crash. Also, not that for n=100 there is no problem.

Here is what the gdb backtrace:

Using host libthread_db library "/lib64/tls/libthread_db.so.1".
*** glibc detected *** free(): invalid next size (fast): 0x0000000000bd1010 ***

Program received signal SIGABRT, Aborted.
0x000000327582e26d in raise () from /lib64/tls/libc.so.6
(gdb) bt
#0  0x000000327582e26d in raise () from /lib64/tls/libc.so.6
#1  0x000000327582fa6e in abort () from /lib64/tls/libc.so.6
#2  0x00000032758635f1 in __libc_message () from /lib64/tls/libc.so.6
#3  0x00000032758691fe in _int_free () from /lib64/tls/libc.so.6
#4  0x0000003275869596 in free () from /lib64/tls/libc.so.6
#5  0x00000032783ae29e in operator delete(void*) () from /usr/lib64/libstdc++.so.6
#6  0x0000000000433e4f in main () at /users/a_user/dsyrdb/main.cpp:53


Viewing all articles
Browse latest Browse all 21

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>