Hi, everyone<br><br>I just check the codes added by Barry for MPIDENSE_MPIAIJ. The codes is as follows. I am wondering what context one may call MatAssemblyBegin and MatAssemblyEnd?<br>From the webpage, I can find some information about two functions:<br>
"Begins assembling the matrix. This routine should be called after completing all calls to MatSetValues()."<br>I mean that I don't know how to judge whether I should call two functions. Could you give me some advice? thanks a lot.<br>
<br>4723 */<br> 4724 PetscErrorCode MatMatMultNumeric_MPIDense_MPIAIJ(Mat A,Mat B,Mat C)<br> 4725 {<br> 4726 PetscErrorCode ierr;<br> 4727 Mat_MPIDense *sub_c = (Mat_MPIDense*)C->data;<br>
4728 Mat At,Bt,Ct;<br> 4729 <br> 4730 PetscFunctionBegin;<br> 4731 ierr = MatTranspose(A,MAT_INITIAL_MATRIX,&At);CHKERRQ(ierr);<br> 4732 ierr = MatTranspose(B,MAT_INITIAL_MATRIX,&Bt);CHKERRQ(ierr);<br>
4733 ierr = MatMatMult(Bt,At,MAT_INITIAL_MATRIX,1.0,&Ct);CHKERRQ(ierr);<br> 4734 ierr = MatDestroy(At);CHKERRQ(ierr);<br> 4735 ierr = MatDestroy(Bt);CHKERRQ(ierr);<br> 4736 ierr = MatTranspose(Ct,MAT_REUSE_MATRIX,&C);CHKERRQ(ierr);<br>
4737 ierr = MatDestroy(Ct);CHKERRQ(ierr);<br> 4738 <br> 4739 C->assembled = PETSC_TRUE;<br> 4740 ierr = MatAssemblyBegin(sub_c->A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);<br> 4741 ierr = MatAssemblyEnd(sub_c->A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);<br>
4742 if (!C->was_assembled) {<br> 4743 ierr = MatSetUpMultiply_MPIDense(C);CHKERRQ(ierr);<br> 4744 }<br> 4745 PetscFunctionReturn(0);<br> 4746 }<br><br><br><br>Regards,<br>Yujie<br>