- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm testing performance of mkl 9.1 on AMD Athlon 2200 processor.
I'm comparing the multiplication of sparse matrix to a vector.
When i compare
mkl_dcsrgemv
against
my simple function shown below
...
for (int i = 0; i < n; i++)
{
x = 0;
for (int j = ia; j < ia[i+1]; j++)
{
int col = ja[j-1] - 1;
x += v[col] * a[j-1];
}
}
...
I'm not getting any significant speed up after my code is compiled with optimization flag in gcc (-O2). I'm seeing only ~2-3% speedup.
Is it a normal behavior or should i be expecting a lot more speedup by using sparse-blas routines?
Thanks
I'm testing performance of mkl 9.1 on AMD Athlon 2200 processor.
I'm comparing the multiplication of sparse matrix to a vector.
When i compare
mkl_dcsrgemv
against
my simple function shown below
...
for (int i = 0; i < n; i++)
{
x = 0;
for (int j = ia; j < ia[i+1]; j++)
{
int col = ja[j-1] - 1;
x += v[col] * a[j-1];
}
}
...
I'm not getting any significant speed up after my code is compiled with optimization flag in gcc (-O2). I'm seeing only ~2-3% speedup.
Is it a normal behavior or should i be expecting a lot more speedup by using sparse-blas routines?
Thanks
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
The performance of the routine mentioned by youdepends on the structure of the inputsparse matrix since the distribution of the nonzero elements in a sparse matrix determines the memory access patterns. So the performance greatly depends on input sparse matrix as well as on the its dimension.
Probably the numbers reported by you are normal. I need to look at the input data.
By the way the routine is OpenMP parallelized. Have you tested it in parallel mode by setting OMP_NUM_THREADS environment variable?
All the best
Sergey
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page