Fast Matrix operations

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
fponta
Posts: 11
Joined: Wed Oct 30, 2013 2:22 pm
Location: Univ. of Trieste

Fast Matrix operations

Post by fponta »

Hello everyone!
I'm writing some C++ code that calculates participation factors and therefore uses matrix and vector multiplications. The point is that the operations coded in Vector.cpp and Matrix.cpp take quite a long time to complete when the model is defined by 500+ nodes and elements. Is there any way to access some faster functions within OpenSees? If so, which files should I include?

Thanks in advance.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Fast Matrix operations

Post by fmk »

you could rewrite the classes or just methods that are slowing you down and rebuild the coed using your classes.

alternativily, you could write your code using the Matrix and Vector classes to set and obtain values in the double * you would use to store the data. The actual operations on the data (the double *) you code yourself or use the blas or boost libraries directly.
fponta
Posts: 11
Joined: Wed Oct 30, 2013 2:22 pm
Location: Univ. of Trieste

Re: Fast Matrix operations

Post by fponta »

Thanks for the reply!
I think I'll opt for obtaining double* data and using the blas libraries... they should be quite optimized by themselves.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Fast Matrix operations

Post by fmk »

yes. though if you can get the ones optimized for your particular machine, e.g. intel mkl, they will work far better than just compiling and using the routines downloaded and compiled from netlib.
fponta
Posts: 11
Joined: Wed Oct 30, 2013 2:22 pm
Location: Univ. of Trieste

Re: Fast Matrix operations

Post by fponta »

Ok, thanks! I'll look into it.
Post Reply