[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
further about PCComputeExplicitOperator()
- To: petsc-users@xxxxxxxxxxx
- Subject: further about PCComputeExplicitOperator()
- From: Yujie <recrusader@xxxxxxxxx>
- Date: Thu, 1 May 2008 17:08:25 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=HGyaMd/BEoZtOUv9nO8HEBvUwzJ72WphK7Eyh79mb4Q=; b=ZvSbWcxXryZM5U+7hD2vw5iwa8BQCYRnwPQ2EqCWR295g/J/2It7J7DnmQ7itff1+Xn9wwkKu2OXS25vs2ioqsaP/77myQBloWNTDPMeDRo53gNs57nW651Qym/AbWLRFoFjYSPMYSXW7y7lus5oCKpH0uiOgDaYogvRQKkKJiI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=UFZsXETT2XzxQ6tUAXq8sX/gkJSNNBxozx2uFZhpmS6bjRa25cm0lb180/6ZTQV3Y64pGJ8hgug7Vq4YXzdWFVIoqQf1RW3kov9/Jojhv3C7OIDd6lFANtT4sOQncOC6pkjSUT6e8qjSuiyzLf86QZ3/9lZAAPZ0jtmqjp0seH0=
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
when 1 processor is used, the matrix M in PCComputeExplicitOperator(pc,&M) uses MATSEQDENSE type. Now, I want to use MATSEQAIJ, I change the codes as follows:
1563 if (size == 1) {
1564 //05/01/08
1565 //ierr = MatSetType(*mat,MATSEQDENSE);CHKERRQ(ierr);
1566 //ierr = MatSeqDenseSetPreallocation(*mat,PETSC_NULL);CHKERRQ(ierr);
1567 ierr = MatSetType(*mat,MATSEQAIJ);CHKERRQ(ierr);
1568 ierr = MatSeqAIJSetPreallocation(*mat,0,PETSC_NULL);CHKERRQ(ierr);
1569
1570 } else {
1571 ierr = MatSetType(*mat,MATMPIAIJ);CHKERRQ(ierr);
1572 ierr = MatMPIAIJSetPreallocation(*mat,0,PETSC_NULL,0,PETSC_NULL);CHKERRQ(ierr);
1573 }
PCApply is fast when running. However, MatSetValues() is very very slow when some arraies need to set. I find that the problem likely lies in
MatSeqXAIJReallocateAIJ(A,A->rmap.n,1,nrow,row,col,rmax,aa,ai,aj,rp,ap,imax,nonew,MatScalar) in MatSetValues_SeqAIJ() after debugging the codes.
I can't further figure out where is the problem. Because it is difficult to debug. Could you give me some advice? thanks a lot.
the version of PETSc is 2.3.3-p8.
thanks a lot.
Regards,
Yujie