<div dir="auto">Pierre,<div dir="auto"><br></div><div dir="auto">Thanks to report this. I think this should be fixed in MatHermitianTransposeAdd. Would you like to open a PR?</div><div dir="auto"><br></div><div dir="auto">Thanks</div><div dir="auto">Stefani</div></div><br><div class="gmail_quote"><div dir="ltr">Il Sab 20 Ott 2018, 08:16 Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr">pierre.jolivet@enseeiht.fr</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
I’m using a MatNest with some blocks made of matrices created with MatCreateHermitianTranspose. I end up with the following trace when doing a simple MatMult.<br>
Should this be fixed in matnest.c, matrix.c or htransm.c?<br>
<br>
Thanks,<br>
Pierre<br>
<br>
(lldb) down<br>
frame #11: 0x000000011ad06830 libpetsc.3.010.dylib`MatMult_Nest(A=0x00007fcc2eb50260, x=0x00007fcc2f019460, y=0x00007fcc2f01ca60) at matnest.c:52<br>
49 for (j=0; j<nc; j++) {<br>
50 if (!bA->m[i][j]) continue;<br>
51 /* y[i] <- y[i] + A[i][j] * x[j] */<br>
-> 52 ierr = MatMultAdd(bA->m[i][j],bx[j],by[i],by[i]);CHKERRQ(ierr);<br>
53 }<br>
54 }<br>
55 for (i=0; i<nr; i++) {ierr = VecRestoreSubVector(y,bA->isglobal.row[i],&by[i]);CHKERRQ(ierr);}<br>
(lldb) <br>
frame #10: 0x000000011a9d6399 libpetsc.3.010.dylib`MatMultAdd(mat=0x00007fcc2ebfde60, v1=0x00007fcc2f029c60, v2=0x00007fcc2f024660, v3=0x00007fcc2f024660) at matrix.c:2517<br>
2514 if (!mat->ops->multadd) SETERRQ1(PetscObjectComm((PetscObject)mat),PETSC_ERR_SUP,"No MatMultAdd() for matrix type '%s'",((PetscObject)mat)->type_name);<br>
2515 ierr = PetscLogEventBegin(MAT_MultAdd,mat,v1,v2,v3);CHKERRQ(ierr);<br>
2516 ierr = VecLockPush(v1);CHKERRQ(ierr);<br>
-> 2517 ierr = (*mat->ops->multadd)(mat,v1,v2,v3);CHKERRQ(ierr);<br>
2518 ierr = VecLockPop(v1);CHKERRQ(ierr);<br>
2519 ierr = PetscLogEventEnd(MAT_MultAdd,mat,v1,v2,v3);CHKERRQ(ierr);<br>
2520 ierr = PetscObjectStateIncrease((PetscObject)v3);CHKERRQ(ierr);<br>
(lldb) <br>
frame #9: 0x000000011ad136d0 libpetsc.3.010.dylib`MatMultAdd_HT(N=0x00007fcc2ebfde60, v1=0x00007fcc2f029c60, v2=0x00007fcc2f024660, v3=0x00007fcc2f024660) at htransm.c:24<br>
21 PetscErrorCode ierr;<br>
22 <br>
23 PetscFunctionBegin;<br>
-> 24 ierr = MatMultHermitianTransposeAdd(Na->A,v1,v2,v3);CHKERRQ(ierr);<br>
25 PetscFunctionReturn(0);<br>
26 }<br>
27 <br>
(lldb) <br>
frame #8: 0x000000011a9d88e5 libpetsc.3.010.dylib`MatMultHermitianTransposeAdd(mat=0x00007fcc2e977260, v1=0x00007fcc2f029c60, v2=0x00007fcc2f024660, v3=0x00007fcc2f024660) at matrix.c:2629<br>
2626 ierr = MatMultTranspose(mat,w,z);CHKERRQ(ierr);<br>
2627 ierr = VecDestroy(&w);CHKERRQ(ierr);<br>
2628 ierr = VecConjugate(z);CHKERRQ(ierr);<br>
-> 2629 ierr = VecWAXPY(v3,1.0,v2,z);CHKERRQ(ierr);<br>
2630 ierr = VecDestroy(&z);CHKERRQ(ierr);<br>
2631 }<br>
2632 ierr = VecLockPop(v1);CHKERRQ(ierr);<br>
(lldb) <br>
frame #7: 0x000000011a8f33b5 libpetsc.3.010.dylib`VecWAXPY(w=0x00007fcc2f024660, alpha=1, x=0x00007fcc2f024660, y=0x00007fcc2f039260) at rvector.c:795<br>
792 VecCheckSameSize(x,3,y,4);<br>
793 VecCheckSameSize(x,3,w,1);<br>
794 if (w == y) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Result vector w cannot be same as input vector y, suggest VecAXPY()");<br>
-> 795 if (w == x) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Result vector w cannot be same as input vector x, suggest VecAYPX()");<br>
796 PetscValidLogicalCollectiveScalar(y,alpha,2);<br>
797 <br>
798 ierr = PetscLogEventBegin(VEC_WAXPY,x,y,w,0);CHKERRQ(ierr);<br>
<br>
</blockquote></div>