<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div><div><div><div><div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; ">I write a simple c procedure to test the MatSetValues. the main body of procedure is like this</div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "> </div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "> int row=1;</div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "> int col=10;</div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "> double v=1.0;</div><div> </div><div> MatSetValues(A,1,&row,1,&col,&v,INSERT_VALUES);</div><div> MatSetValues(A,1,&row,1,&row,
&v,ADD_VALUES);</div><div> MatSetValues(A,1,&col,1,&col,&v,ADD_VALUES);</div><div><br></div><div> MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);<div> MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);</div><br><span title="neteasefooter" style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "><span id="netease_mail_footer"></span></span></div><div>I run with 4 cpus, when i view the matrix, the diagonal value is wrong ,it is 1 not 4.0. but if i delete the code "MatSetValues(A,1,&row,1,&col,&v,INSERT_VALUES)", it can gives me the correct answer.</div><div><br></div><div> could you please tell me the reason. </div><div>Regards.</div><div>thank you very much.</div><br><br><span title="neteasefooter" style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "><span id="netease_mail_footer"></span></span></div><br><br><span title="neteasefooter" style="color: rgb(0,
0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "><span id="netease_mail_footer"></span></span></div><br><br><span title="neteasefooter" style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "><span id="netease_mail_footer"></span></span></div><br><br><span title="neteasefooter" style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "><span id="netease_mail_footer"></span></span></div><br><br><span title="neteasefooter" style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px; line-height: 1.7; "><span id="netease_mail_footer"></span></span></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>