ergo
mat_thread_test.cc File Reference

Performs some matrix operations and outputs timings. More...

#include <stdio.h>
#include <unistd.h>
#include <memory>
#include <limits>
#include "matrix_typedefs.h"
#include "matrix_utilities.h"
#include "utilities.h"

Functions

static void get_random_positive_definite_matrix (symmMatrix &result, mat::SizesAndBlocks sizeBlockInfo, int n)
 
int main (int argc, char *argv[])
 

Detailed Description

Performs some matrix operations and outputs timings.

The point is to demonstrate the problem with the matrix library becoming extremely slow when OpenMP is used with gcc. Running this test with OMP_NUM_THREADS=1 and OMP_NUM_THREADS=2 gives dramatically different performance (threaded runs are about 700 times slower than serial).

Function Documentation

◆ get_random_positive_definite_matrix()

static void get_random_positive_definite_matrix ( symmMatrix result,
mat::SizesAndBlocks  sizeBlockInfo,
int  n 
)
static

◆ main()