#include #include "mkl.h" #include "assert.h" #include #define NTimes 11 #define AL 0.0 #define BU 1.0 // icc -DMKL_ILP64 -mkl test_getrf_huge.cpp // How to use: test.exe // square case // N ~120K. Mem_size == 120000 * 120000 * sizeof(double) == 112 GB int main( int argc, char *argv[] ) { if( argc != 2){ printf("\t... zero input arguments... \n"); printf("\t... How to call: test.exe ... \n"); exit(-1); } MKL_INT size = atoi(argv[1]); if( size < 4 ) { printf("\t...the input problem size < 4 is too small... \n"); exit(-2); } MKL_INT i,j; MKL_INT n = size; MKL_INT lda = n; //allocation double* a1 = (double*) mkl_calloc( n*n, sizeof(double), 64); // square matrix MKL_INT* ipiv = (MKL_INT*)mkl_calloc( n, sizeof(MKL_INT), 64); // ipiv - Array, size at least max(1,min(m, n)). assert( NULL != ipiv || NULL != a1 ); for( i = 0; i < n; i++ ) { for ( j=0; j < n; j++) { a1[j+i*n] = (double)rand()/RAND_MAX*(BU-AL) + AL; } } MKL_INT info = LAPACKE_dgetrf(LAPACK_ROW_MAJOR, n , n , a1 , lda , ipiv ); assert(NULL == info); printf("...LAPACKE_dgetrf returns %d, SIZE = %d", info, n ); mkl_free(ipiv); mkl_free(a1); return 0; }