<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 15, 2014 at 5:57 AM, Projet_TRIOU <span dir="ltr"><<a href="mailto:triou@cea.fr" target="_blank">triou@cea.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I switched from PETSc 3.3 to PETSc 3.4.3 and all was fine except for<br>
one of my test case on 3 processors where one processor was<br>
dealing an empty local part of the global matrix.<br>
<br>
My code hangs just during the call at MatAssemblyEnd:<br>
<br>
ierr = MatMPIAIJSetPreallocation(<u></u>MatricePetsc, PETSC_DEFAULT, d_nnz.addr(), PETSC_DEFAULT, o_nnz.addr());<br>
...<br>
ierr = MatAssemblyEnd(MatricePetsc, MAT_FINAL_ASSEMBLY);<br>
<br>
When I debugged, I notice on the empty processor, that in<br>
src/mat/impls/aij/mpi/mpiaij.<u></u>c:<br>
<br>
  if (!((Mat_SeqAIJ*)aij->B->data)-<u></u>>nonew) {<br>
    ierr = MPI_Allreduce(&mat->was_<u></u>assembled,&other_disassembled,<u></u>1,MPIU_BOOL,MPI_PROD,<u></u>PetscObjectComm((PetscObject)<u></u>mat));CHKERRQ(ierr);<br>
    if (mat->was_assembled && !other_disassembled) {<br>
      ierr = MatDisAssemble_MPIAIJ(mat);<u></u>CHKERRQ(ierr);<br>
    }<br></blockquote><div><br></div><div>Good call. This is definitely a bug. I will get it fixed.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

((Mat_SeqAIJ*)aij->B->data)-><u></u>nonew was 0 on the "empty" processor<br>
and -2 on the 2 others...<br>
<br>
I bypassed my problem with a different call to MatMPIAIJSetPreallocation():<br>
<br>
      if (nb_rows==0) // Local matrix is empty<br>
         ierr = MatMPISBAIJSetPreallocation(<u></u>MatricePetsc, block_size_, 0, NULL, 0, NULL);<br>
      else<br>
         ierr = MatMPISBAIJSetPreallocation(<u></u>MatricePetsc, block_size_, PETSC_DEFAULT, d_nnz.addr(), PETSC_DEFAULT, o_nnz.addr());<br>
<br>
Now, it runs well. So I don't know if it is a PETSc regression or if I was abusively<br>
calling MatMPISBAIJSetPreallocation with d_nnz/o_nnz empty arrays....<br>
<br>
Thanks,<br>
<br>
Pierre<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>