Boost logo

Ublas :

From: Riccardo Rossi (rrossi_at_[hidden])
Date: 2007-09-25 07:36:58


Hi peter, could you expand on the NUMA stuff?

i have been doing tests with a compressed matrix in parallel and it DOES
make a huge difference the matrix vector prod on NUMA systems (opteron
sunfire) depending on how you initialize the matrix.

do you have any proposal on how to cleanly initialize things in parallel?

thx in advance
Riccardo

Peter Schmitteckert wrote:
> Dear Georg,
>
> Georg Baum wrote:
>
>> Am Dienstag 25 September 2007 09:00 schrieb Peter Schmitteckert:
>>
>>
>>> Well, there is no guarantee that a matrix gets initialized to zero.
>>>
>> You are right.
>>
>>
>>> (Or is a guarantee introduced recently?)
>>>
>> Fortunately not. Unfortunately despite the missing guarantee its is in
>> practice quite often zero, so that it is easy to forget a clear() :-(
>> In this case I simply confused ublas clear() with std::vector::clear()
>> (which resizes to zero).
>>
> Well, both set the matrices to zero matrices.
>
>
> Fortunately it is not guaranteed, even if it is often zero. There is a big difference on NUMA
> machines (non-uniform memory architecture) in a parallel environment.
> Suppose you want to define some matrices in the main code and you want to fill
> them in threads, then you end up with non-thread local memory, if you already
> access the memory in the main part. Of course, you could then avoid it by resizing
> the matrix, but that is additional programming afford.
>
> Best regards,
> Peter
>
>
H