> On Dec 4, 2014, at 9:43 AM, Young, Matthew, Adam <[email protected]> wrote: > > Is there an advantage to using MatXAIJSetPreallocation (as Jed suggested) or > either of the SEQ/MPI preallocation routines (as Hui originally considered) > instead of calling MatSetUp to cover all cases?
Yes, from the manual page: MatSetUp - Sets up the internal matrix data structures for the later use. Collective on Mat Input Parameters: . A - the Mat context Notes: If the user has not set preallocation for this matrix then a default preallocation that is likely to be inefficient is used. > ------------------------------------------- > Matthew Young > Graduate Student > Boston University Dept. of Astronomy > ------------------------------------------- > > > ________________________________________ > From: [email protected] [[email protected]] on > behalf of Jed Brown [[email protected]] > Sent: Thursday, December 04, 2014 10:35 AM > To: Sun, Hui; [email protected] > Subject: Re: [petsc-users] Question about preallocation and getOwnership > functions > > "Sun, Hui" <[email protected]> writes: > >> After reading some documentation, I figured it out myself. MATAIJ can >> be MATSEQAIJ or MATMPIAIJ, depending on the number of processors >> involved. Thus, I need to include the command >> MatSeqAIJSetPreallocation as well, to cover both cases. > > Or call MatXAIJSetPreallocation and be done with it for all *AIJ > formats.
