<div dir="ltr">I see MUMPS <a href="http://mumps.enseeiht.fr/">http://mumps.enseeiht.fr/</a><div><ul style="margin-bottom:1.3em;color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial"><li style="line-height:1.3em;margin-bottom:0.65em"><strong>Sparse multiple right-hand side, distributed solution</strong>; Exploitation of sparsity in the right-hand sides</li></ul>PETSc interface computes mumps <strong style="color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial">distributed solution </strong><span style="color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial">as default (this is not new) (ICNTL(21) = 1)</span></div><div style="text-align:justify"><br></div><div><span style="color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial">I will add support for <strong style="color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial">Sparse multiple right-hand side.</strong></span></div><div><span style="color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial"><strong style="color:rgb(0,0,0);font-family:serif,Georgia,"Times New Roman";font-size:14.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,221);text-decoration-style:initial;text-decoration-color:initial"><br></strong></span></div><div style="text-align:justify"><font color="#000000" face="serif, Georgia, Times New Roman"><span style="font-size:14.4px;background-color:rgb(255,255,221)">Hong</span></font></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 31, 2018 at 11:25 AM, Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Hong,<br>
<br>
    Can you see about adding support for distributed right hand side?<br>
<br>
    Thanks<br>
<span class="HOEnZb"><font color="#888888"><br>
      Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> On May 31, 2018, at 2:37 AM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>> wrote:<br>
> <br>
> The fix for MAT_NEW_NONZERO_LOCATIONS, thanks again.<br>
> <br>
> I have yet another question, sorry. The recent version of MUMPS supports distributed and sparse RHS is there any chance that this will be supported in PETSc in the near future?<br>
> <br>
>  <br>
>  <br>
> <br>
>> On May 30, 2018, at 6:55 PM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>> wrote:<br>
>> <br>
>> Thanks for the quick fix, I will test it and report back.<br>
>> I have another maybe related question, if MAT_NEW_NONZERO_LOCATIONS is true and let's say 1 new nonzero position is created it does not allocated 1 but several new nonzeros but only use 1.<br>
> <br>
> Correct<br>
> <br>
>> I think that is normal, right?<br>
> <br>
> Yes<br>
> <br>
>> But, at least as far as I understand the manual, a subsequent call of mat assemble with<br>
>> MAT_FINAL_ASSEMBLY should compress out the unused allocations and release the memory, is this correct?<br>
> <br>
> It "compresses it out" (by shifting all the nonzero entries to the beginning of the internal i, j, and a arrays), but does NOT release any memory. Since the values are stored in one big contiguous array (obtained with a single malloc) it cannot just free part of the array, so the extra locations just sit harmlessly at the end if the array unused.<br>
> <br>
>> If so, this did not work for me, even after doing<br>
>> MAT_FINAL_ASSEMBLY the unused nonzero allocations remain. Is this normal?<br>
> <br>
> Yes,<br>
> <br>
> Barry<br>
> <br>
>> <br>
>>> <br>
>>> Fixed in the branch barry/fix-mat-new-nonzero-<wbr>locations/maint<br>
>>> <br>
>>> Once this passes testing it will go into the maint branch and then the next patch release but you can use it now in the branch barry/fix-mat-new-nonzero-<wbr>locations/maint<br>
>>> <br>
>>> Thanks for the report and reproducible example<br>
>>> <br>
>>> Barry<br>
>>> <br>
>>> <br>
>>>> On May 29, 2018, at 7:51 PM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>> wrote:<br>
>>>> <br>
>>>> Sure, I made a small reproducer, it is Fortran though I hope that is ok. If MAT_NEW_NONZERO_LOCATIONS is set to false I get an error, if it is set to true the new nonzero element is inserted, if MAT_NEW_NONZERO_LOCATIONS is false and either MAT_NEW_NONZERO_LOCATION_ERR or MAT_NEW_NONZERO_ALLOCATION_ERR is set to false afterwards then the new nonzero is also created without an error, but if MAT_NEW_NONZERO_LOCATIONS is set to false after MAT_NEW_NONZERO_LOCATION_ERR/<wbr>MAT_NEW_NONZERO_ALLOCATION_ERR have been set to false I get an error again.<br>
>>>> <br>
>>>> <br>
>>>> program newnonzero<br>
>>>> #include <petsc/finclude/petscmat.h><br>
>>>> use petscmat<br>
>>>> implicit none<br>
>>>> <br>
>>>> Mat :: A<br>
>>>> PetscInt :: dnnz,onnz,n,m,idxm(1),idxn(1),<wbr>nl1,nl2<br>
>>>> PetscScalar :: v(1)<br>
>>>> PetscReal :: info(MAT_INFO_SIZE)<br>
>>>> PetscErrorCode :: ierr<br>
>>>> <br>
>>>> integer :: nproc,iproc,i<br>
>>>> <br>
>>>> call PetscInitialize(PETSC_NULL_<wbr>CHARACTER,ierr)<br>
>>>> <br>
>>>> call MPI_COMM_SIZE(PETSC_COMM_<wbr>WORLD, nproc,ierr)<br>
>>>> <br>
>>>> call MPI_Comm_rank( PETSC_COMM_WORLD, iproc, ierr )<br>
>>>> <br>
>>>> n=3<br>
>>>> m=n<br>
>>>> call MatCreateAIJ(PETSC_COMM_WORLD,<wbr>PETSC_DECIDE,PETSC_DECIDE,n,m,<wbr>1,PETSC_NULL_INTEGER,0,PETSC_<wbr>NULL_INTEGER,A,ierr)<br>
>>>> <br>
>>>> <br>
>>>> call MatGetOwnershipRange(A,nl1,<wbr>nl2,ierr)<br>
>>>> do i=nl1,nl2-1<br>
>>>> idxn(1)=i<br>
>>>> idxm(1)=i<br>
>>>> v(1)=1d0<br>
>>>> call MatSetValues(A,1,idxn,1,idxm, v,INSERT_VALUES,ierr)<br>
>>>> end do<br>
>>>> call MatAssemblyBegin(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>> call MatAssemblyEnd(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>> <br>
>>>> call MatSetOption(A,MAT_NEW_<wbr>NONZERO_LOCATIONS,PETSC_FALSE,<wbr>ierr)<br>
>>>> !~ call MatSetOption(A,MAT_NEW_<wbr>NONZERO_LOCATION_ERR,PETSC_<wbr>FALSE,ierr)<br>
>>>> !~ call MatSetOption(A,MAT_NEW_<wbr>NONZERO_ALLOCATION_ERR ,PETSC_FALSE,ierr)<br>
>>>> !~ call MatSetOption(A,MAT_NEW_<wbr>NONZERO_LOCATIONS,PETSC_FALSE,<wbr>ierr)<br>
>>>> <br>
>>>> <br>
>>>> idxn(1)=0<br>
>>>> idxm(1)=n-1<br>
>>>> if ((idxn(1).ge.nl1).and.(idxn(1)<wbr>.le.nl2-1)) then<br>
>>>> v(1)=2d0<br>
>>>> call MatSetValues(A,1,idxn,1,idxm, v,INSERT_VALUES,ierr)<br>
>>>> end if<br>
>>>> call MatAssemblyBegin(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>> call MatAssemblyEnd(A,MAT_FINAL_<wbr>ASSEMBLY,ierr)<br>
>>>> <br>
>>>> if ((idxn(1).ge.nl1).and.(idxn(1)<wbr>.le.nl2-1)) then<br>
>>>> v(1)=2d0<br>
>>>> call MatGetValues(A,1,idxn,1,idxm, v,ierr)<br>
>>>> write(6,*) v<br>
>>>> end if<br>
>>>> <br>
>>>> call PetscFinalize(ierr)<br>
>>>> <br>
>>>> end program newnonzero<br>
>>>> <br>
>>>> <br>
>>>> <br>
>>>> $ mpiexec.hydra -n 3 ./a.out<br>
>>>> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
>>>> [0]PETSC ERROR: Argument out of range<br>
>>>> [0]PETSC ERROR: Inserting a new nonzero at global row/column (0, 2) into matrix<br>
>>>> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
>>>> [0]PETSC ERROR: Petsc Release Version 3.9.2, May, 20, 2018<br>
>>>> [0]PETSC ERROR: ./a.out on a named tono-hpc1 by marius Wed May 30 09:42:40 2018<br>
>>>> [0]PETSC ERROR: Configure options --prefix=/home/marius/prog/<wbr>petsc/3.9.2 --download-elemental=yes --download-metis=yes --download-parmetis=yes --download-mumps=yes --with-scalapack-lib="/home/<wbr>marius/intel/compilers_and_<wbr>libraries_2018.2.199/linux/<wbr>mkl/lib/intel64/libmkl_<wbr>scalapack_lp64.a -Wl,--start-group /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>intel_lp64.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>sequential.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>core.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -lm -ldl" --FC=mpiifort --CC=mpicc --CXX=mpicxx --with-scalar-type=complex --with-mpi-dir= --with-blaslapack-lib="/home/<wbr>marius/intel/compilers_and_<wbr>libraries_2018.2.199/linux/<wbr>mkl/lib/intel64/libmkl_<wbr>scalapack_lp64.a -Wl,--start-group /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>intel_lp64.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>sequential.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>core.a /home/marius/intel/compilers_<wbr>and_libraries_2018.2.199/<wbr>linux/mkl/lib/intel64/libmkl_<wbr>blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -lm -ldl" --with-cxx-dialect=C++11 --download-superlu_dist=yes --download-ptscotch=yes --with-x --with-debugging=1 --download-superlu=yes --with-mkl_cpardiso=1 --with-mkl_pardiso=1 --with-scalapack=1<br>
>>>> [0]PETSC ERROR: #1 MatSetValues_MPIAIJ() line 607 in /home/marius/prog/petsc/petsc-<wbr>3.9.2/src/mat/impls/aij/mpi/<wbr>mpiaij.c<br>
>>>> [0]PETSC ERROR: #2 MatSetValues() line 1312 in /home/marius/prog/petsc/petsc-<wbr>3.9.2/src/mat/interface/<wbr>matrix.c<br>
>>>> (0.000000000000000E+000,0.<wbr>000000000000000E+000)<br>
>>>> <br>
>>>> <br>
>>>> <br>
>>>> Please send complete error message; type of matrix used etc. Ideally code that demonstrates the problem.<br>
>>>> <br>
>>>> Barry<br>
>>>> <br>
>>>> <br>
>>>>> On May 29, 2018, at 3:31 AM, Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>> wrote:<br>
>>>>> <br>
>>>>> <br>
>>>>> Hi,<br>
>>>>> <br>
>>>>> I tried to set MAT_NEW_NONZERO_LOCATIONS to false, as far as I understood MatSetValues should simply ignore entries which would give rise to new nonzero values not creating a new entry and not cause an error, but I get "[1]PETSC ERROR: Inserting a new nonzero at global row/column". Is this option supposed to work or not?<br>
>>>> <br>
>>> <br>
>>> <br>
>  <br>
<br>
</div></div></blockquote></div><br></div></div>