[Trilinos-Users] [EXTERNAL] Epetra and importing into serial maps

Heroux, Michael A maherou at sandia.gov
Wed Apr 18 12:05:26 MDT 2012


This construction pattern is not explicitly supported.  Presently the way
you could accomplish this is to construct a distributed map that on each
processor lists the rows you want on that processor.  Once this new
distributed object is constructed, the local portion on each processor
should be close to what you need (a superset of the data you need).  You
could then construct a View of this data to make a truly local version of
the matrix.

If you want more than one local matrix per processor, then you would need
to do the import as many times as there are instances of a local matrix on
a processor.  Even if other processors have fewer local matrices, they
would participate in the collective import operation with no data.

You could use a conceptually cleaner approach by forming one import object
per block (as you have done below), but the map should still be
distributed, with only the target processor having a nontrivial GID list.
This approach is very close to what you have already, and might be a good
starting point.

I hope this helps.


On 4/18/12 4:04 AM, "Jonas Thies" <jonas at math.uu.se> wrote:

>Hi all,
>I am trying to accomplish something like this
>- from a distributed Epetra_CrsMatrix A, say based on MPI_COMM_WORLD
>- extract a serial submatrix A_loc of which I can guarantee that all
>required data is already on the process.
>There may be a varying number of A_locs per processor (or none at all),
>and I want a loop like this
>for (int i=0;i<nblocks;i++) A_loc[i]->Import(A,import[i],Zero)).
>. So what I tried up to now is:
>- A_loc based on a map with a SerialComm or MpiComm(MPI_COMM_SELF)
>- building Epetra_Import objects in a loop -> program hangs if not the
>same number of A_locs on each process (some collective communication
>there even though the number of Export/ImportIDs is 0?)
>- building an Epetra_Export object works but then the actual
>A_loc->Import call gives errors, segfaults etc., depending
>on how exactly I try to do it.
>How should I do this, I think I basically want to call the private
>member function ´CopyAndPermute´. Is it actually allowed to have
>different comms in the two maps?
>Jonas Thies
>Centre for Interdisciplinary Mathematics
>Uppsala University
>phone +46 (0)18 471 32 09
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov

More information about the Trilinos-Users mailing list