[Trilinos-Users] Tpetra CRS matrix repeated fill - howto

Heroux, Mike MHeroux at CSBSJU.EDU
Mon Nov 24 16:13:38 MST 2014


Martin,

Just a general statement on the construction process.  Your step 1 will be
a very important step for thread-scalable execution as we go forward on
manycore platforms.  The fake assembly is needed to determine the storage
requirements for unstructured objects, prior to doing allocation.

We call this the ³count-analyze-allocate-fill-compute² pattern.  It shows
up regularly in thread-scalable code.  The reason it is important is that
the allocate phase cannot be done dynamically without serious performance
loss.

So your approach, although inconvenient, is how you will want to do it in
the future anyway, IMO.

Mike

On 11/24/14, 3:46 PM, "Martin Vymazal" <martin.vymazal at vki.ac.be> wrote:

>Hello Mark,
>
>  you say that sumIntoGlobalValues is more efficient than
>insertGlobalValues. However, I still have to do step 1) at least once
>(say during the setup phase). When I omit 1) completely, I end up with
>an exception saying that the matrix has zero columns
>(sumIntoGlobalValues didn't create any entries in the matrix I suppose).
>
>Best regards,
>
>   Martin Vymazal
>
>
>On 11/24/2014 10:20 PM, Hoemmen, Mark wrote:
>> On 11/24/14, 12:00 PM, "trilinos-users-request at software.sandia.gov"
>> <trilinos-users-request at software.sandia.gov> wrote:
>>> Message: 1
>>> Date: Mon, 24 Nov 2014 11:21:42 +0100
>>> From: Martin Vymazal <martin.vymazal at vki.ac.be>
>>> To: "'trilinos-users at software.sandia.gov'"
>>> 	<trilinos-users at software.sandia.gov>
>>> Subject: [Trilinos-Users] Tpetra CRS matrix repated fill - howto
>>> Message-ID: <4870639.qbSfTX3zYp at tinlaptop>
>>> Content-Type: text/plain; charset="us-ascii"
>>>
>>> Hello,
>>>
>>> I'm a bit confused about the proper order of steps to fill Tpetra CRS
>>> matrix
>>> (which is allocated dynamically with a size hint). I need to fill the
>>> matrix
>>> repeatedly in an iterative procedure. The structure of the matrix will
>>>be
>>> preserved, only its entries will have different values.
>>>
>>> Currently I do this:
>>> 1) Perform a fake assembly loop over the system and call
>>> 'insertGlobalValues'
>>> to create corresponding row entries
>>> 2) Do the real assembly in each iteration and call
>>>'sumIntoGlobalValues'
>>>
>>> The documentation says that 'insertGlobalValues' inserts corresponding
>>> row
>>> values and 'If that entry already exists, add the new value to the old
>>> value.'
>>> I thought that this means that I could skip step 1) above and just call
>>> 'insertGlobalValues' every time I assemble my matrix.
>> It is more efficient to use sumIntoGlobalValues (or even
>> sumIntoLocalValues if you can) for the assembly loop (repeated instances
>> of Step 2 above).
>>
>>> This is what I got instead:
>>>
>>> Tpetra::CrsMatrix<double, int, int,
>>> KokkosClassic::SerialNode>::insertGlobalValues: new indices exceed
>>> statically
>>> allocated graph structure.
>>>
>>> Could you please tell me what is the correct procedure to initialize
>>>the
>>> entries in Tpetra CRS matrix and then fill it repeatedly?
>> This is a known bug in Tpetra::Crs{Graph,Matrix} which I plan to fix
>>once
>> I get the chance.  Currently, Tpetra sums repeated entries in each row
>>at
>> fillComplete, not as they are inserted.
>>
>> mfh
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> https://software.sandia.gov/mailman/listinfo/trilinos-users
>
>_______________________________________________
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov
>https://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list