#include #include #include "mkl.h" #include #include #include #define NUM_THREADS (std::thread::hardware_concurrency()) int main(int argc, char *argv[]) { /* * test program for intel guys * usage: ./test nrDimensions * nrDimensions = d = an integer value that should theoretically be as large as infinity * * filename descriptions: * M.txt = sparse matrix values * jM.txt = column indices for the sparse matrix M * iM.txt = row indices specifying first nonzero value (or w/e the convention is) at the respective row * * M is adouble precision array, and jM/iM are both 32 bit integer arrays */ int d = atoi(argv[1]); double *M,*eigs,*output; MKL_INT *iM, *jM; FILE *EM, *JM, *IM; EM = fopen("M.txt", "r"); JM = fopen("jM.txt", "r"); IM = fopen("iM.txt", "r"); //First two elements of iM are the number of rows and number of nonzero elements--makes reading input easier. MKL_INT nrRows, nrElements; fscanf(IM, "%d\t%d", &nrRows,&nrElements); iM = (MKL_INT*) calloc(nrRows+1,sizeof(MKL_INT)); M = (double*) calloc(nrElements,sizeof(double)); jM = (MKL_INT*) calloc(nrElements,sizeof(MKL_INT)); //setting the nrROws+1 element to the nrElements+1 per specification iM[nrRows] = nrElements+1; //fill in the rest for(int i=0; i