<div dir="ltr"><div>We have a bug in the AMGx test snes_tests-ex13_amgx in parallel.</div><div>Matt Martineau found that MatMPIAIJGetLocalMat worked in the first pass in the code below, where the local matrix is created (INITIAL), but in the next pass, when "REUSE" is used, he sees an invalid pointer.</div><div>Matt found that it does have offloadmask == CPU. </div><div>Maybe it is missing logic to put the output in same state as the input?</div><div><br></div><div>Any ideas on this or should I just dig into it?</div><div><br></div><div>Thanks,</div><div><pre class="gmail-c-mrkdwn__pre" style="box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;white-space:pre-wrap;word-break:normal;border-radius:4px;color:rgb(29,28,29);font-family:Monaco,Menlo,Consolas,"Courier New",monospace">bool partial_setup_allowed = (pc->setupcalled && pc->flag != DIFFERENT_NONZERO_PATTERN);
199 if (amgx->nranks > 1) {
200 if (partial_setup_allowed) {
202 PetscCall(MatMPIAIJGetLocalMat(Pmat, MAT_REUSE_MATRIX, &amgx->localA)); // This path seems doesn't work by the time we reach AmgX API
203 } else {
205 PetscCall(MatMPIAIJGetLocalMat(Pmat, MAT_INITIAL_MATRIX, &amgx->localA)); // This path works
206 }
207 } else {
208 amgx->localA = Pmat;
209 }
210</pre></div></div>