Boost logo

Ublas :

Subject: Re: [ublas] Element-wise operations are really slow
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2010-04-25 13:32:36


Xiss,
I run your code with:

const int numNodes = 100000;
const int numTetrahedrons = numNodes*4;
.....
ublas::generalized_vector_of_vector<float, ublas::row_major, ublas::vector<ublas::mapped_vector<float> > > K(numNodes*3, numNodes*3);
.....
//assemble K a few times
const int N = 1;

Compiled it with:
g++ -o test main.cpp -DNDEBUG -O3

and it turned out that it assembles the matrix in 1.84secs on my core2 duo laptop. Do you feel this is slow for a 300,000 degrees of freedom sparse stiffness matrix?

Last but not least. Do you compile in "release" mode in MSVC?

Best
Nasos

Date: Sun, 25 Apr 2010 02:50:19 -0300
From: xissburg_at_[hidden]
To: ublas_at_[hidden]
Subject: Re: [ublas] Element-wise operations are really slow

Here goes a sample code which performs pretty much the same operations that are performed in the main code, also with the same kind of access patterns. It is much faster than my code (around x10+ faster), probably because everything is very well aligned in contiguous blocks of memory like the element stiffness matrices and indices, which again suggests I have cache issues. Then my only hope now is to try a new data structure design where all these data which is used in that section of the code is contained in contiguous blocks of memory, something more cache friendly.

Any help is welcome.

Thanks,

x
                                               
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5