[petsc-users] MatChop

Matthew Knepley knepley at gmail.com
Fri May 21 11:49:54 CDT 2021


On Fri, May 21, 2021 at 12:33 PM Stefano Zampini <stefano.zampini at gmail.com>
wrote:

>
>
> On 21 May 2021, at 7:17 PM, Pierre Jolivet <pierre at joliv.et> wrote:
>
>
>
> On 21 May 2021, at 6:03 PM, Stefano Zampini <stefano.zampini at gmail.com>
> wrote:
>
> Emmanuel
>
> thanks for reporting this.
> I believe we have a regression in MatChop from
> https://gitlab.com/petsc/petsc/-/commit/038df967165af8ac6c3de46a36f650566a7db07c
> (cc'ing Pierre)
> We call MatAssemblyBegin/End within the row loop. Also. I don't understand
> why we need to check for  r < rend herre
> https://gitlab.com/petsc/petsc/-/blob/038df967165af8ac6c3de46a36f650566a7db07c/src/mat/utils/axpy.c#L513.
> nor why we need to allocate newCols (can use cols)
>
>
> That part is from the initial 8-year old implementation from Matt (
> https://gitlab.com/petsc/petsc/-/commit/4325cce7191c5c61f4f090c59eaf6773fdee7b48#9d78409dea8190bffda8b68fee5aef233dc1c677
> ).
> You need the check otherwise this error is raised:
> https://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line566
> .
>
>
> I see, anyway you do not need the check if the loop range [rStart,rEnd).
> So now I don’t understand why the loop must be [rStart,rStart+maxRows],
> Matt?
>

It is terrible, but I could not see a way around it. We want to use
MatGetRow() for each row, but that requires an assembled matrix. We want to
use
MatSetValues() to changes things, but that unassembles the matrix, so we
need an assembly at each iteration, but assembly is collective, so everyone
has
to take the same number of iterations. Thus, maxRows.

   Matt

> Thanks,
> Pierre
>
> Pierre, can you take a look?
>
> Il giorno ven 21 mag 2021 alle ore 18:49 Emmanuel Ayala <juaneah at gmail.com>
> ha scritto:
>
>> Hi everybody,
>>
>> I just updated petsc from version 13 to 15. Before the update everything
>> works well, then my code give me an error:
>>
>> [9]PETSC ERROR: --------------------- Error Message
>> --------------------------------------------------------------
>> [9]PETSC ERROR: Invalid argument
>> [9]PETSC ERROR: Setting off process row 53484 even though
>> MatSetOption(,MAT_NO_OFF_PROC_ENTRIES,PETSC_TRUE) was set
>> [9]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html
>> for trouble shooting.
>> [9]PETSC ERROR: Petsc Release Version 3.15.0, Mar 30, 2021
>> [9]PETSC ERROR: ./comp on a arch-linux-c-opt-O2-superlud_mumps_hyp named
>> eayala by ayala Fri May 21 10:40:36 2021
>> [9]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2
>> -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native"
>> FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich
>> --download-hypre --download-mumps --download-scalapack --download-parmetis
>> --download-metis --download-superlu_dist --download-cmake
>> --download-fblaslapack=1 --with-cxx-dialect=C++11
>>
>> The error appears after a matrix assembly, the matrix was created with
>> DMCreateMatrix and updated with MatSetValuesLocal.
>>
>> A Little work around I found the solution, avoid using MatChop on this
>> matrix, but I still need to use MatChop. There is any reason to have this
>> problem?
>>
>> Thanks in advance.
>>
>>
>>
>>
>>
>
> --
> Stefano
>
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210521/6bfd64da/attachment.html>


More information about the petsc-users mailing list