Matrix multiplication by vector slow with uBLAS
Hi,
I was digging in my code to try to find some reason for the slowdown I get using the updated(>0.9.5) versions of dolfin,
(since the dolfin demos do not reproduce the huge time differences I have in my code).
I've found that the main issue is the matrix by vector multiplication that I use in some methods .
When using uBLAS backend I get a huge slowdown compared with PETSc
In the simple dolfin code below PETSc is at least 40 times faster.
Is this an expected behavior?
I reproduced the problem in a simple code:
main.cpp:
-------
#include <dolfin.h>
#include "TestForm.h"
using namespace dolfin;
int main(int argc, char *argv[])
{
parameters[
Timer maintimer(argv[1]);
maintimer.
UnitSquare mesh(100,100);
TestForm:
TestForm:
TestForm:
Constant f(1.0);
L.f=f;
Matrix A;
assemble(A,a);
Vector x;
assemble(x,L);
Vector y(x);
y.zero();
A.mult(x,y);
maintimer.stop();
summary();
}
-------
with
TestForm.ufl:
-------
scalar = FiniteElement(
v = TestFunction(
u1 = TrialFunction(
f= Coefficient(
a = v*u1*dx
L = f*v*dx
-------
using uBLAS approx 2.5s and with PETSc approx 0.06s.
Could someone please test the code...
Thanks in advance.
Nuno Lopes.
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Nuno Lopes for more information if necessary.