Hello,

I have a question to which I think the answer may be "no" but I thought I 
would ask. I'll just ask and then explain the "why?" at the end in case 
there is a better work around from the outset.

I am initializing MPI myself with MPI_THREAD_MULTIPLE so that threads can 
each call MPI functions without interfering. To the extent possible each 
thread has its own copy of MPI_COMM_WORLD so that simultaneous calls do not 
get convoluted. However, I have a matrix of type 
TrilinosWrappers::SparseMatrix which BOTH threads need simultaneous access 
to. Since you must give one and only one MPI_Comm object in the 
constructor, these sorts of conflicts are inevitable.

For obvious reasons I would not like to require a copy of this matrix for 
each thread. The other obvious solution is a mutex on the matrix, but this 
could easily get costly as both threads are calling matrix.vmult(...) in an 
iterative solver. I thus have two questions:

1) Is initializing MPI with MPI_THREAD_MULTIPLE going to break the deal.ii 
internals for some reason and I should just not investigate this further?

2) I think the best solution, if possible, would be to get pointers to the 
internal data of my matrix which I can then associate with different 
MPI_Comm objects. Is this possible?

Why am I doing this?
This is a bit of a simplification, but imagine that I am solving a linear 
deferred correction problem. This means at each time step I solve A . x_1 = 
b_1 and A . x_2 = b_2. Let us assume that the matrix A does not have a 
well-known preconditioner which scales nicely with the number of 
processors. Then instead of using 2n processors on each linear system in 
series, we could instead use n processors on each linear system 
simultaneously and expect this to be faster. I hope this makes sense.

Thanks for any tips you can offer.

Regards,
Kyle

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/9947c725-d102-4868-9b6c-939168bad21an%40googlegroups.com.

Reply via email to