[petsc-users] Efficient interaction of local and distributed Mat/Vec

Thomas Witkowski Thomas.Witkowski at tu-dresden.de
Mon Nov 21 07:31:48 CST 2011

In my FETI-DP code, there are many interactions between local and  
distributed data structures (matrices, vectors). Mainly, there is on  
each rank a matrix mat_bb (MATSEQAIJ) representing the local subdomain  
problem (without the primal nodes). In my implementation, the  
corresponding vector f_b is a distributed VECMPI. Thus, on each rank  
the local part of f_b corresponds to the size of the local matrix  
mat_bb. For each solution with mat_bb and the right-hand-side f_b, my  
code creates a temporary vector f_b_seq (VECSEQ), creates two IS (for  
the global indices in f_b and the local in f_b_seq), and copy the  
values from f_b to f_b_seq with a VecScatter. After the solution with  
m_b_b, the same is done the other way round.

This works fine. My question: Is this the best/most efficient way to  
do it with PETSc? I'm not really sure. It's a lot of code and I do not  
like the idea of coping the same value from one date structure to  
another one just to make them "compatible" in some way.

Thanks for any suggestions,


More information about the petsc-users mailing list