about MatCreateSeqAIJ and MatCreateMPIAIJ

Yixun Liu yxliu at fudan.edu.cn
Tue Oct 24 01:31:07 CDT 2006


Hi,
Thanks.

I need two things to be confirmed. For example, I have 4 processors and the codes are like,

PetscInitialize();
...
MatCreateSeqAIJ();
...
PetscFinalize();

Can I draw the conclusion that each code between PetscInitialize() and  PetscFinalize() will be called by each processor? So, each processor will have a sequential matrix.

Best,

Yixun


----- Original Message ----- 
From: "Satish Balay" <balay at mcs.anl.gov>
To: "PETSC" <petsc-users at mcs.anl.gov>
Sent: Tuesday, October 24, 2006 11:39 AM
Subject: Re: about MatCreateSeqAIJ and MatCreateMPIAIJ


> On Tue, 24 Oct 2006, Yixun Liu wrote:
> 
>> Hi,
>> I am confused with this two routines.
>> 
>> MatCreateMPIAIJ(PETSC_COMM_WORLD,...) creates a parallel
>> matrix,which will be distributed on all the
>> processors. MatCreateSeqAIJ(PETSC_COMM_SELF, ...) creates a
>> sequential matrix. But because this routine will be called by each
>> processor, which processor create this matrix?
> 
> If the routine is called on each processor - then each of them will
> have a sequential matrix.
> 
> Generally one uses SeqAIJ when running the application on only one
> processor. Also one can think of a case where someone might want to
> store sequential matrices on each processor [the matrix sizes/values
> being different on each proc]
> 
> For eg: We internally store MPIAIJ mat as a collection of SeqAIJ
> matrices on each proc. For additional info - check the 'Example usage'
> section at:
> 
> http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateMPIAIJ.html
> 
> Satish
>




More information about the petsc-users mailing list