I am working on a 24 core machine, with ~400GB of memory, running Ubuntu. I am encountering a segmentation fault when doing a simple matrix multiplication using Intel MKL cblas\_dgemm:

```
  int k=5;
  int m=2E5;
  int n=3E4;
  double * A = (double *)mkl_malloc( m*k*sizeof( double ), 64 );
  UTILITIES::check_alloc("A", A); //Check alloc just checks if the pointer is null
  UTILITIES::random_matrix(m,k,A); //fills matrix with random numbers

  double * B = (double *)mkl_malloc( k*n*sizeof( double ), 64 );
  UTILITIES::check_alloc("B", B);
  UTILITIES::random_matrix(k,n,B); //files matrix with random numbers

  double * TestMatrix = (double *)mkl_malloc( m*n*sizeof( double ), 64 );
  printf("Allocating a matrix of size %le\n",(double) m*n*sizeof(double)); //4.8E10
  UTILITIES::check_alloc("TestMatrix", TestMatrix);//No problem

  for (int i=0; i<m*n; i++) { //I added this just to make sure I could allocate the memory, of course this will all be overwritten
    TestMatrix[i] = 1.0;
  }

  printf("TestMatrix %lf\n", TestMatrix[1]); //no problem accessing the memory

  cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, m,n,k,
      1.0,
      A,k,
      B,n,
      0.0,
      TestMatrix,n); //Segfaults at this line (without it, there is no segfault).

```

If I change the size of the matrices, to make n=1E4, there is no segmentation fault. 

Do you have any thoughts?

Note that I have confirmed that I am compiling with 64 bits:

```
#if __x86_64__
  printf("Running 64 bit\n");
#endif

```

My compile line: 

```
g++ -m64 main.cpp -I/opt/intel/composer_xe_2013_sp1.0.080/mkl/include -L/opt/intel/composer_xe_2013_sp1.0.080/mkl/lib/intel64 -lmkl_rt;

```