Ben,

These two lines

  added_sp.block(0, 1).copy_from(col);
  added_sp.block(1, 0).copy_from(row);

account for about 60% of the bottleneck (considering only the runtime for the piece of code in the original post).

These I can give back to you:
  https://github.com/dealii/dealii/pull/6081
:-)


The other 40% of the bottleneck is from the line

added_Jacobian_matrix.block(1, 0).reinit(
single,
partitioning,
added_sp.block(1, 0),
MPI_COMM_WORLD,
false);

Interestingly, the reinit for the block(0,1) matrix is negligible. I assume this is related to block(1,0) living on a single processor, and block(0,1) being distributed. All the other lines have negligible contribution to the runtime.

That is indeed interesting.

The reinit() function here for the Trilinos matrix looks innocuous. I suspect that the time is lost in Trilinos, but I've learned to be cautious about such claims. The function reinit_matrix() in which you ultimately spend the time is in source/lac/trilinos_sparse_matrix.cc starting at line 461. If you wanted to time its individual parts to find out what is happening, that would be the place for it.


The reason I fill the row and col vectors with ones (correct me if I'm misunderstanding) is so the sparsity pattern will have non-zero entries. The vectors I use to fill the (0,1) and (1,0) matrices are dense, so this seemed like the safest choice.

Yes. Any nonzero entry would have been fine. One is a good value absent any other needs.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to