Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Manuel Colera Rico via petsc-users

After adding that line the problem gets fixed.

Regards,

Manuel

---

On 3/13/19 3:13 PM, Zhang, Junchao wrote:

Manuel,
  Could you try to add this line
     sbaij->free_imax_ilen = PETSC_TRUE;
 after line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c


 PS: Matt, this bug looks unrelated to my VecRestoreArrayRead_Nest fix.

--Junchao Zhang


On Wed, Mar 13, 2019 at 9:05 AM Matthew Knepley > wrote:


On Wed, Mar 13, 2019 at 9:44 AM Manuel Colera Rico via petsc-users
mailto:petsc-users@mcs.anl.gov>> wrote:

Yes:

[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c


Junchao, do imax and ilen get missed in the Destroy with the user
provides arrays?


https://bitbucket.org/petsc/petsc/src/06a3e802b3873ffbfd04b71a0821522327dd9b04/src/mat/impls/sbaij/seq/sbaij.c#lines-2431

    Matt

I have checked that I have destroyed all the MatNest matrices
and all
the submatrices individually.

Manuel

---

On 3/13/19 2:28 PM, Jed Brown wrote:
> Is there any output if you run with -malloc_dump?
>
> Manuel Colera Rico via petsc-users mailto:petsc-users@mcs.anl.gov>> writes:
>
>> Hi, Junchao,
>>
>> I have installed the newest version of PETSc and it works
fine. I just
>> get the following memory leak warning:
>>
>> Direct leak of 28608 byte(s) in 12 object(s) allocated from:
>>   #0 0x7f1ddd5caa38 in __interceptor_memalign
>>
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
>>   #1 0x7f1ddbef1213 in PetscMallocAlign
>>

(/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213)
>>
>> Thank you,
>>
>> Manuel
>>
>> ---
>>
>> On 3/12/19 7:08 PM, Zhang, Junchao wrote:
>>> Hi, Manuel,
>>>    I recently fixed a problem in VecRestoreArrayRead.
Basically, I
>>> added VecRestoreArrayRead_Nest. Could you try the master
branch of
>>> PETSc to see if it fixes your problem?
>>>    Thanks.
>>>
>>> --Junchao Zhang
>>>
>>>
>>> On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via
petsc-users
>>> mailto:petsc-users@mcs.anl.gov>
>> wrote:
>>>
>>>      Hello,
>>>
>>>      I need to solve a 2*2 block linear system. The
matrices A_00, A_01,
>>>      A_10, A_11 are constructed separately via
>>>      MatCreateSeqAIJWithArrays and
>>>      MatCreateSeqSBAIJWithArrays. Then, I construct the
full system matrix
>>>      with MatCreateNest, and use MatNestGetISs and
PCFieldSplitSetIS to
>>>      set
>>>      up the PC, trying to follow the procedure described here:
>>>

https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.
>>>
>>>      However, when I run the code with Leak Sanitizer, I
get the
>>>      following error:
>>>
>>>
=
>>>      ==54927==ERROR: AddressSanitizer: attempting free on
address which
>>>      was
>>>      not malloc()-ed: 0x62751ab8 in thread T0
>>>       #0 0x7fbd95c08f30 in __interceptor_free
>>>
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
>>>       #1 0x7fbd92b99dcd in PetscFreeAlign
>>>

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
>>>       #2 0x7fbd92ce0178 in VecRestoreArray_Nest
>>>

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
>>>       #3 0x7fbd92cd627d in VecRestoreArrayRead
>>>

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
>>>       #4 0x7fbd92d1189e in VecScatterBegin_SSToSS
>>>

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
>>>       #5 0x7fbd92d1a414 in VecScatterBegin
>>>

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
 

Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Zhang, Junchao via petsc-users
Manuel,
  Could you try to add this line
 sbaij->free_imax_ilen = PETSC_TRUE;
 after line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c

 PS: Matt, this bug looks unrelated to my VecRestoreArrayRead_Nest fix.

--Junchao Zhang


On Wed, Mar 13, 2019 at 9:05 AM Matthew Knepley 
mailto:knep...@gmail.com>> wrote:
On Wed, Mar 13, 2019 at 9:44 AM Manuel Colera Rico via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:
Yes:

[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c

Junchao, do imax and ilen get missed in the Destroy with the user provides 
arrays?

  
https://bitbucket.org/petsc/petsc/src/06a3e802b3873ffbfd04b71a0821522327dd9b04/src/mat/impls/sbaij/seq/sbaij.c#lines-2431

Matt

I have checked that I have destroyed all the MatNest matrices and all
the submatrices individually.

Manuel

---

On 3/13/19 2:28 PM, Jed Brown wrote:
> Is there any output if you run with -malloc_dump?
>
> Manuel Colera Rico via petsc-users 
> mailto:petsc-users@mcs.anl.gov>> writes:
>
>> Hi, Junchao,
>>
>> I have installed the newest version of PETSc and it works fine. I just
>> get the following memory leak warning:
>>
>> Direct leak of 28608 byte(s) in 12 object(s) allocated from:
>>   #0 0x7f1ddd5caa38 in __interceptor_memalign
>> ../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
>>   #1 0x7f1ddbef1213 in PetscMallocAlign
>> (/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213)
>>
>> Thank you,
>>
>> Manuel
>>
>> ---
>>
>> On 3/12/19 7:08 PM, Zhang, Junchao wrote:
>>> Hi, Manuel,
>>>I recently fixed a problem in VecRestoreArrayRead. Basically, I
>>> added VecRestoreArrayRead_Nest. Could you try the master branch of
>>> PETSc to see if it fixes your problem?
>>>Thanks.
>>>
>>> --Junchao Zhang
>>>
>>>
>>> On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via petsc-users
>>> mailto:petsc-users@mcs.anl.gov> 
>>> >> wrote:
>>>
>>>  Hello,
>>>
>>>  I need to solve a 2*2 block linear system. The matrices A_00, A_01,
>>>  A_10, A_11 are constructed separately via
>>>  MatCreateSeqAIJWithArrays and
>>>  MatCreateSeqSBAIJWithArrays. Then, I construct the full system matrix
>>>  with MatCreateNest, and use MatNestGetISs and PCFieldSplitSetIS to
>>>  set
>>>  up the PC, trying to follow the procedure described here:
>>>  
>>> https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.
>>>
>>>  However, when I run the code with Leak Sanitizer, I get the
>>>  following error:
>>>
>>>  =
>>>  ==54927==ERROR: AddressSanitizer: attempting free on address which
>>>  was
>>>  not malloc()-ed: 0x62751ab8 in thread T0
>>>   #0 0x7fbd95c08f30 in __interceptor_free
>>>  ../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
>>>   #1 0x7fbd92b99dcd in PetscFreeAlign
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
>>>   #2 0x7fbd92ce0178 in VecRestoreArray_Nest
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
>>>   #3 0x7fbd92cd627d in VecRestoreArrayRead
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
>>>   #4 0x7fbd92d1189e in VecScatterBegin_SSToSS
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
>>>   #5 0x7fbd92d1a414 in VecScatterBegin
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
>>>   #6 0x7fbd934a999c in PCApply_FieldSplit
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
>>>   #7 0x7fbd93369071 in PCApply
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
>>>   #8 0x7fbd934efe77 in KSPInitialResidual
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
>>>   #9 0x7fbd9350272c in KSPSolve_GMRES
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
>>>   #10 0x7fbd934e3c01 in KSPSolve
>>>  
>>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)
>>>
>>>  Disabling Leak Sanitizer also outputs an "invalid pointer" error.
>>>
>>>  Did I forget something when writing the code?
>>>
>>>  Thank you,

Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Lawrence Mitchell via petsc-users



> On 13 Mar 2019, at 14:04, Matthew Knepley via petsc-users 
>  wrote:
> 
> On Wed, Mar 13, 2019 at 9:44 AM Manuel Colera Rico via petsc-users 
>  wrote:
> Yes:
> 
> [ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
> /opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
> [ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
> /opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
> [ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
> /opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
> [ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
> /opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
> 
> Junchao, do imax and ilen get missed in the Destroy with the user provides 
> arrays?
> 
>   
> https://bitbucket.org/petsc/petsc/src/06a3e802b3873ffbfd04b71a0821522327dd9b04/src/mat/impls/sbaij/seq/sbaij.c#lines-2431

Looks like it. One probably needs something like:

diff --git a/src/mat/impls/sbaij/seq/sbaij.c b/src/mat/impls/sbaij/seq/sbaij.c
index 2b98394140..c39fc696d8 100644
--- a/src/mat/impls/sbaij/seq/sbaij.c
+++ b/src/mat/impls/sbaij/seq/sbaij.c
@@ -2442,6 +2442,7 @@ PetscErrorCode  MatCreateSeqSBAIJWithArrays(MPI_Comm 
comm,PetscInt bs,PetscInt m
   sbaij->nonew= -1; /*this indicates that inserting a new 
value in the matrix that generates a new nonzero is an error*/
   sbaij->free_a   = PETSC_FALSE;
   sbaij->free_ij  = PETSC_FALSE;
+  sbaij->free_imax_ilen = PETSC_TRUE;
 
   for (ii=0; iiilen[ii] = sbaij->imax[ii] = i[ii+1] - i[ii];

Lawrence

Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Manuel Colera Rico via petsc-users
The warning that Leak Sanitizer gives me is not what I wrote two 
messages before (I apologize). It is:


Direct leak of 25920 byte(s) in 4 object(s) allocated from:
    #0 0x7fa97e35aa38 in __interceptor_memalign 
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
    #1 0x7fa97cc81213 in PetscMallocAlign 
(/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213)


which seems to be in accordance (at least in number of leaked bytes) to 
-malloc_dump's output.


Manuel

---

On 3/13/19 2:44 PM, Manuel Colera Rico wrote:

Yes:

[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c


I have checked that I have destroyed all the MatNest matrices and all 
the submatrices individually.


Manuel

---

On 3/13/19 2:28 PM, Jed Brown wrote:

Is there any output if you run with -malloc_dump?

Manuel Colera Rico via petsc-users  writes:


Hi, Junchao,

I have installed the newest version of PETSc and it works fine. I just
get the following memory leak warning:

Direct leak of 28608 byte(s) in 12 object(s) allocated from:
      #0 0x7f1ddd5caa38 in __interceptor_memalign
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
      #1 0x7f1ddbef1213 in PetscMallocAlign
(/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213) 



Thank you,

Manuel

---

On 3/12/19 7:08 PM, Zhang, Junchao wrote:

Hi, Manuel,
   I recently fixed a problem in VecRestoreArrayRead. Basically, I
added VecRestoreArrayRead_Nest. Could you try the master branch of
PETSc to see if it fixes your problem?
   Thanks.

--Junchao Zhang


On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via petsc-users
mailto:petsc-users@mcs.anl.gov>> wrote:

 Hello,

 I need to solve a 2*2 block linear system. The matrices A_00, 
A_01,

 A_10, A_11 are constructed separately via
 MatCreateSeqAIJWithArrays and
 MatCreateSeqSBAIJWithArrays. Then, I construct the full system 
matrix
 with MatCreateNest, and use MatNestGetISs and 
PCFieldSplitSetIS to

 set
 up the PC, trying to follow the procedure described here:
https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.

 However, when I run the code with Leak Sanitizer, I get the
 following error:

=
 ==54927==ERROR: AddressSanitizer: attempting free on address 
which

 was
 not malloc()-ed: 0x62751ab8 in thread T0
  #0 0x7fbd95c08f30 in __interceptor_free
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
  #1 0x7fbd92b99dcd in PetscFreeAlign
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
  #2 0x7fbd92ce0178 in VecRestoreArray_Nest
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
  #3 0x7fbd92cd627d in VecRestoreArrayRead
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
  #4 0x7fbd92d1189e in VecScatterBegin_SSToSS
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
  #5 0x7fbd92d1a414 in VecScatterBegin
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
  #6 0x7fbd934a999c in PCApply_FieldSplit
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
  #7 0x7fbd93369071 in PCApply
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
  #8 0x7fbd934efe77 in KSPInitialResidual
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
  #9 0x7fbd9350272c in KSPSolve_GMRES
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
  #10 0x7fbd934e3c01 in KSPSolve
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)

 Disabling Leak Sanitizer also outputs an "invalid pointer" error.

 Did I forget something when writing the code?

 Thank you,

 Manuel

 ---



Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Manuel Colera Rico via petsc-users

Yes:

[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]8416 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c
[ 0]4544 bytes MatCreateSeqSBAIJWithArrays() line 2431 in 
/opt/PETSc_library/petsc-3.10.4/src/mat/impls/sbaij/seq/sbaij.c


I have checked that I have destroyed all the MatNest matrices and all 
the submatrices individually.


Manuel

---

On 3/13/19 2:28 PM, Jed Brown wrote:

Is there any output if you run with -malloc_dump?

Manuel Colera Rico via petsc-users  writes:


Hi, Junchao,

I have installed the newest version of PETSc and it works fine. I just
get the following memory leak warning:

Direct leak of 28608 byte(s) in 12 object(s) allocated from:
      #0 0x7f1ddd5caa38 in __interceptor_memalign
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
      #1 0x7f1ddbef1213 in PetscMallocAlign
(/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213)

Thank you,

Manuel

---

On 3/12/19 7:08 PM, Zhang, Junchao wrote:

Hi, Manuel,
   I recently fixed a problem in VecRestoreArrayRead. Basically, I
added VecRestoreArrayRead_Nest. Could you try the master branch of
PETSc to see if it fixes your problem?
   Thanks.

--Junchao Zhang


On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via petsc-users
mailto:petsc-users@mcs.anl.gov>> wrote:

 Hello,

 I need to solve a 2*2 block linear system. The matrices A_00, A_01,
 A_10, A_11 are constructed separately via
 MatCreateSeqAIJWithArrays and
 MatCreateSeqSBAIJWithArrays. Then, I construct the full system matrix
 with MatCreateNest, and use MatNestGetISs and PCFieldSplitSetIS to
 set
 up the PC, trying to follow the procedure described here:
 
https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.

 However, when I run the code with Leak Sanitizer, I get the
 following error:

 =
 ==54927==ERROR: AddressSanitizer: attempting free on address which
 was
 not malloc()-ed: 0x62751ab8 in thread T0
  #0 0x7fbd95c08f30 in __interceptor_free
 ../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
  #1 0x7fbd92b99dcd in PetscFreeAlign
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
  #2 0x7fbd92ce0178 in VecRestoreArray_Nest
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
  #3 0x7fbd92cd627d in VecRestoreArrayRead
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
  #4 0x7fbd92d1189e in VecScatterBegin_SSToSS
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
  #5 0x7fbd92d1a414 in VecScatterBegin
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
  #6 0x7fbd934a999c in PCApply_FieldSplit
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
  #7 0x7fbd93369071 in PCApply
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
  #8 0x7fbd934efe77 in KSPInitialResidual
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
  #9 0x7fbd9350272c in KSPSolve_GMRES
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
  #10 0x7fbd934e3c01 in KSPSolve
 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)

 Disabling Leak Sanitizer also outputs an "invalid pointer" error.

 Did I forget something when writing the code?

 Thank you,

 Manuel

 ---



Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Jed Brown via petsc-users
Is there any output if you run with -malloc_dump?

Manuel Colera Rico via petsc-users  writes:

> Hi, Junchao,
>
> I have installed the newest version of PETSc and it works fine. I just 
> get the following memory leak warning:
>
> Direct leak of 28608 byte(s) in 12 object(s) allocated from:
>      #0 0x7f1ddd5caa38 in __interceptor_memalign 
> ../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
>      #1 0x7f1ddbef1213 in PetscMallocAlign 
> (/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213)
>
> Thank you,
>
> Manuel
>
> ---
>
> On 3/12/19 7:08 PM, Zhang, Junchao wrote:
>> Hi, Manuel,
>>   I recently fixed a problem in VecRestoreArrayRead. Basically, I 
>> added VecRestoreArrayRead_Nest. Could you try the master branch of 
>> PETSc to see if it fixes your problem?
>>   Thanks.
>>
>> --Junchao Zhang
>>
>>
>> On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via petsc-users 
>> mailto:petsc-users@mcs.anl.gov>> wrote:
>>
>> Hello,
>>
>> I need to solve a 2*2 block linear system. The matrices A_00, A_01,
>> A_10, A_11 are constructed separately via
>> MatCreateSeqAIJWithArrays and
>> MatCreateSeqSBAIJWithArrays. Then, I construct the full system matrix
>> with MatCreateNest, and use MatNestGetISs and PCFieldSplitSetIS to
>> set
>> up the PC, trying to follow the procedure described here:
>> 
>> https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.
>>
>> However, when I run the code with Leak Sanitizer, I get the
>> following error:
>>
>> =
>> ==54927==ERROR: AddressSanitizer: attempting free on address which
>> was
>> not malloc()-ed: 0x62751ab8 in thread T0
>>  #0 0x7fbd95c08f30 in __interceptor_free
>> ../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
>>  #1 0x7fbd92b99dcd in PetscFreeAlign
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
>>  #2 0x7fbd92ce0178 in VecRestoreArray_Nest
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
>>  #3 0x7fbd92cd627d in VecRestoreArrayRead
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
>>  #4 0x7fbd92d1189e in VecScatterBegin_SSToSS
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
>>  #5 0x7fbd92d1a414 in VecScatterBegin
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
>>  #6 0x7fbd934a999c in PCApply_FieldSplit
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
>>  #7 0x7fbd93369071 in PCApply
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
>>  #8 0x7fbd934efe77 in KSPInitialResidual
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
>>  #9 0x7fbd9350272c in KSPSolve_GMRES
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
>>  #10 0x7fbd934e3c01 in KSPSolve
>> 
>> (/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)
>>
>> Disabling Leak Sanitizer also outputs an "invalid pointer" error.
>>
>> Did I forget something when writing the code?
>>
>> Thank you,
>>
>> Manuel
>>
>> ---
>>


Re: [petsc-users] PCFieldSplit with MatNest

2019-03-13 Thread Manuel Colera Rico via petsc-users

Hi, Junchao,

I have installed the newest version of PETSc and it works fine. I just 
get the following memory leak warning:


Direct leak of 28608 byte(s) in 12 object(s) allocated from:
    #0 0x7f1ddd5caa38 in __interceptor_memalign 
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:111
    #1 0x7f1ddbef1213 in PetscMallocAlign 
(/opt/PETSc_library/petsc-3.10.4/mcr_20190313/lib/libpetsc.so.3.10+0x150213)


Thank you,

Manuel

---

On 3/12/19 7:08 PM, Zhang, Junchao wrote:

Hi, Manuel,
  I recently fixed a problem in VecRestoreArrayRead. Basically, I 
added VecRestoreArrayRead_Nest. Could you try the master branch of 
PETSc to see if it fixes your problem?

  Thanks.

--Junchao Zhang


On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:


Hello,

I need to solve a 2*2 block linear system. The matrices A_00, A_01,
A_10, A_11 are constructed separately via
MatCreateSeqAIJWithArrays and
MatCreateSeqSBAIJWithArrays. Then, I construct the full system matrix
with MatCreateNest, and use MatNestGetISs and PCFieldSplitSetIS to
set
up the PC, trying to follow the procedure described here:

https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.

However, when I run the code with Leak Sanitizer, I get the
following error:

=
==54927==ERROR: AddressSanitizer: attempting free on address which
was
not malloc()-ed: 0x62751ab8 in thread T0
 #0 0x7fbd95c08f30 in __interceptor_free
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
 #1 0x7fbd92b99dcd in PetscFreeAlign

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
 #2 0x7fbd92ce0178 in VecRestoreArray_Nest

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
 #3 0x7fbd92cd627d in VecRestoreArrayRead

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
 #4 0x7fbd92d1189e in VecScatterBegin_SSToSS

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
 #5 0x7fbd92d1a414 in VecScatterBegin

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
 #6 0x7fbd934a999c in PCApply_FieldSplit

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
 #7 0x7fbd93369071 in PCApply

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
 #8 0x7fbd934efe77 in KSPInitialResidual

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
 #9 0x7fbd9350272c in KSPSolve_GMRES

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
 #10 0x7fbd934e3c01 in KSPSolve

(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)

Disabling Leak Sanitizer also outputs an "invalid pointer" error.

Did I forget something when writing the code?

Thank you,

Manuel

---



Re: [petsc-users] PCFieldSplit with MatNest

2019-03-12 Thread Zhang, Junchao via petsc-users
Hi, Manuel,
  I recently fixed a problem in VecRestoreArrayRead. Basically, I added 
VecRestoreArrayRead_Nest. Could you try the master branch of PETSc to see if it 
fixes your problem?
  Thanks.

--Junchao Zhang


On Mon, Mar 11, 2019 at 6:56 AM Manuel Colera Rico via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:
Hello,

I need to solve a 2*2 block linear system. The matrices A_00, A_01,
A_10, A_11 are constructed separately via MatCreateSeqAIJWithArrays and
MatCreateSeqSBAIJWithArrays. Then, I construct the full system matrix
with MatCreateNest, and use MatNestGetISs and PCFieldSplitSetIS to set
up the PC, trying to follow the procedure described here:
https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.

However, when I run the code with Leak Sanitizer, I get the following error:

=
==54927==ERROR: AddressSanitizer: attempting free on address which was
not malloc()-ed: 0x62751ab8 in thread T0
 #0 0x7fbd95c08f30 in __interceptor_free
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
 #1 0x7fbd92b99dcd in PetscFreeAlign
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
 #2 0x7fbd92ce0178 in VecRestoreArray_Nest
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
 #3 0x7fbd92cd627d in VecRestoreArrayRead
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
 #4 0x7fbd92d1189e in VecScatterBegin_SSToSS
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
 #5 0x7fbd92d1a414 in VecScatterBegin
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
 #6 0x7fbd934a999c in PCApply_FieldSplit
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
 #7 0x7fbd93369071 in PCApply
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
 #8 0x7fbd934efe77 in KSPInitialResidual
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
 #9 0x7fbd9350272c in KSPSolve_GMRES
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
 #10 0x7fbd934e3c01 in KSPSolve
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)

Disabling Leak Sanitizer also outputs an "invalid pointer" error.

Did I forget something when writing the code?

Thank you,

Manuel

---



[petsc-users] PCFieldSplit with MatNest

2019-03-11 Thread Manuel Colera Rico via petsc-users

Hello,

I need to solve a 2*2 block linear system. The matrices A_00, A_01, 
A_10, A_11 are constructed separately via MatCreateSeqAIJWithArrays and 
MatCreateSeqSBAIJWithArrays. Then, I construct the full system matrix 
with MatCreateNest, and use MatNestGetISs and PCFieldSplitSetIS to set 
up the PC, trying to follow the procedure described here: 
https://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html.


However, when I run the code with Leak Sanitizer, I get the following error:

=
==54927==ERROR: AddressSanitizer: attempting free on address which was 
not malloc()-ed: 0x62751ab8 in thread T0
    #0 0x7fbd95c08f30 in __interceptor_free 
../../../../gcc-8.1.0/libsanitizer/asan/asan_malloc_linux.cc:66
    #1 0x7fbd92b99dcd in PetscFreeAlign 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x146dcd)
    #2 0x7fbd92ce0178 in VecRestoreArray_Nest 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28d178)
    #3 0x7fbd92cd627d in VecRestoreArrayRead 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x28327d)
    #4 0x7fbd92d1189e in VecScatterBegin_SSToSS 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2be89e)
    #5 0x7fbd92d1a414 in VecScatterBegin 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x2c7414)
    #6 0x7fbd934a999c in PCApply_FieldSplit 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa5699c)
    #7 0x7fbd93369071 in PCApply 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0x916071)
    #8 0x7fbd934efe77 in KSPInitialResidual 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa9ce77)
    #9 0x7fbd9350272c in KSPSolve_GMRES 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xaaf72c)
    #10 0x7fbd934e3c01 in KSPSolve 
(/opt/PETSc_library/petsc/manuel_OpenBLAS_petsc/lib/libpetsc.so.3.8+0xa90c01)


Disabling Leak Sanitizer also outputs an "invalid pointer" error.

Did I forget something when writing the code?

Thank you,

Manuel

---