I’m trying to get a handle on the different ways of constructing matrices.  
Currently, I have:

MatCreate(...)
MatSetSizes(...)
MatSetFromOptions(...)
MatSetUp(…)

but I gather from reading the manual that, by not preallocating, I’m losing out 
in performance.  If I assume that my matrix will either by SeqAIJ or MPIAIJ, 
depending on the number of processors available, how would I go about doing 
this.  I see some of the example codes with:

MatSeqAIJSetPreallocation(…)
MatMPIAIJSetPreallocation(…)

as successive commands.  Should I interpret this as saying that PETSc will just 
ignore the one that is not the active one in the current instance? 

-gideon

Reply via email to