[petsc-users] MatMPIAIJSetPreallocationCSR

Barry Smith bsmith at mcs.anl.gov
Wed May 14 08:27:59 CDT 2014


On May 14, 2014, at 7:42 AM, Oliver Browne <oliver.browne at upm.es> wrote:

> Hi,
> 
> I am using MatMPIAIJSetPreallocationCSR to preallocate the rows, columns and values for my matrix (efficiency). I have my 3 vectors in CSR format. If I run on a single processor, with my test case, everything works fine. I also worked without MatMPIAIJSetPreallocationCSR, and individually input each value with the call MatSetValues in MPI and this also works fine.
> 
> If I want to use MatMPIAIJSetPreallocationCSR, do I need to separate the vectors for each processor as they have done here;

   What do you mean by “separate” the vectors? Each processor needs to provide ITS rows to the function call. You cannot have processor zero deliver all the rows. 

   

   Barry

> 
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocationCSR.html#MatMPIAIJSetPreallocationCSR
> 
> Thanks in advance,
> 
> Ollie
> 



More information about the petsc-users mailing list