[Trilinos-Users] ThreadSafe parallel assembly

Heroux, Michael A maherou at sandia.gov
Thu Apr 17 04:47:14 MDT 2014


Riccardo,

The code you are seeing was developed by a student working on the LifeV project.  It works well in specific contexts.  Below is his response to me, that I am forwarding to you.

I hope it is helpful.

Mike



The changes to the matrix classes in Epetra were minimal. I made them inside EPETRA_HAVE_OMP_NONASSOCIATIVE blocks, as a safety issue, but it's not really related to non associative operations.

Change number one was that for local row insertions in Epetra CrsMatrix I ensured thread safety with Openmp atomic operations. If the client calls SumIntoGlobalValues inside an Openmp parallel region, then the operation is fast and safe.

Number two is that if overlapping maps are used for the matrix (or off-process indices are discarded in the constructor) then off process contributions to the indices are completely ignored - previously, they were still collected but then discarded "at the last minute". If overlapping maps are not used, the operations are still made thread safe with an Openmp critical region, but this is not very fast.

From: trilinos-users-bounces at software.sandia.gov<mailto:trilinos-users-bounces at software.sandia.gov> [trilinos-users-bounces at software.sandia.gov<mailto:trilinos-users-bounces at software.sandia.gov>] on behalf of Riccardo Rossi [rrossi at cimne.upc.edu<mailto:rrossi at cimne.upc.edu>]
Sent: Sunday, April 13, 2014 12:22 PM
To: trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>
Subject: [EXTERNAL] [Trilinos-Users] ThreadSafe parallel assembly

Dear list,

i have been looking at the code in the EpetraCRS matrix and found
that if "EPETRA_HAVE_OMP_NONASSOCIATIVE" is defined
the function "SumIntoGlobalValues" shall be threadsafe.

does it exist any documentation of this? any other interesting option?

thx in advance
Riccardo

<http://www.cimne.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20140417/b9bfca39/attachment.html>


More information about the Trilinos-Users mailing list