<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Sorry, I’m not very proficient in petsc4py, and there are a bunch of interfaces missing, e.g., ISShift(), so it may not be optimal, but I hope you’ll understand.<div class="">First, you’ll need to regenerate the .bin by uncommenting the proper part of the code.</div><div class="">That is because you were initially generating a 20x20 matrix, with 4 fields per unknown.</div><div class="">That’s 5 unknowns, and so, with two processes, 10 rows per process is not consistent as 10/4 is not an integer — I don’t know how to force, in petsc4py, the local size to 12 on process #0 and 8 on process #1.</div><div class="">The modified code generates a 16x16 matrices so it remains consistent.</div><div class="">If you then run the first part of the program, you’ll get both B_uu and B_pp from B instead of A, with one, two, or four processes.</div><div class="">Again, that should work for arbitrary number of processes, you just need to be careful that your local dimensions are consistent with the number of fields.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre</div><div class=""> </div><div class=""></div></body></html>