Re: [petsc-users] memory corruption when using harmonic extraction with SLEPc

2018-08-06 Thread Dave May
Please always use "reply-all" so that your messages go to the list.
This is standard mailing list etiquette.  It is important to preserve
threading for people who find this discussion later and so that we do
not waste our time re-answering the same questions that have already
been answered in private side-conversations.  You'll likely get an
answer faster that way too.




On 6 August 2018 at 17:17, Moritz Cygorek  wrote:

> Hi,
>
>
> I have found that the memory corruption takes place at the end of the
> first iteration or the beginning of the second iteration, i.e., at a time
> where I expect the harmonic extraction part to do some calculations.
>

Where is the report from valgrind indicating the exact file/function/line
where the problem occurred?



> I've then played around with the command line options and I found that
> harmonic extraction works when -eps_ncv is set to smaller values.
>
> I have the feeling that the memory needs to sustain this number of vectors
> and the eigenvectors for all processes individually. If I run multiple
> processes on a single computer, much more memory is required for storage
> than when I only use a single process, eventually allocating all of the
> available memory
>
>
> Do you know if this behavior of the harmonic extraction routine
> intended/necessary?
>
>
> Regards,
> Moritz
>
>
>
>
>
>
>
> --
> *From:* Dave May 
> *Sent:* Friday, August 3, 2018 12:59:54 AM
> *To:* Moritz Cygorek
> *Cc:* petsc-users@mcs.anl.gov
> *Subject:* Re: [petsc-users] memory corruption when using harmonic
> extraction with SLEPc
>
> On Thu, 2 Aug 2018 at 21:32, Moritz Cygorek  wrote:
>
>> Hi,
>>
>>
>> I want to diagonalize a huge sparse matrix and I'm using the Kryov-Schur
>> method with harmonic extraction (command line option -eps_harmonic )
>> implemented in SLEPc.
>>
>>
>> I manually distribute a sparse matrix across several CPUs and everything
>> works fine when:
>>
>> - I do _not_ use harmonic extraction
>>
>> - I use harmonic extraction on only a single CPU
>>
>>
>> If I try do use harmonic extraction on multiple CPUs, I get a memory
>> corruption.
>>
>> I'm not quite sure where to look at, but somewhere in the output, I find:
>>
>>
>>
>> [1]PETSC ERROR: PetscMallocValidate: error detected at
>> PetscSignalHandlerDefault() line 145 in /home/applications/sources/
>> libraries/petsc-3.9.3/src/sys/error/signal.c
>> [1]PETSC ERROR: Memory [id=0(9072)] at address 0x145bcd0 is corrupted
>> (probably write past end of array)
>> [1]PETSC ERROR: Memory originally allocated in DSAllocateWork_Private()
>> line 74 in /home/applications/sources/libraries/slepc-3.9.2/src/sys/
>> classes/ds/interface/dspriv.c
>>
>>
>> Now, I have the feeling that this might be a bug in SLEPc because, if I
>> had messed up the matrix initialization and distribution, I should also get
>> a memory corruption when I don't use harmonic extraction, right?
>>
>
> Not necessarily
>
>
>> Any suggestions what might be going on?
>>
>
> Run your code through valgrind and make sure that your application code is
> clean. See here
>
> http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
>
> If errors are detected in your application code, fix them and see if the
> slepc errors go away. If your code is valgrind clean, send through the
> relevant chunk of the valgrind report indicating exactly where the error is
> occurring
>
> Thanks,
>   Dave
>
>
>
>> Regards,
>>
>> Moritz
>>
>>
>>
>>
>>
>>
>>
>>


Re: [petsc-users] memory corruption when using harmonic extraction with SLEPc

2018-08-02 Thread Dave May
On Thu, 2 Aug 2018 at 21:32, Moritz Cygorek  wrote:

> Hi,
>
>
> I want to diagonalize a huge sparse matrix and I'm using the Kryov-Schur
> method with harmonic extraction (command line option -eps_harmonic )
> implemented in SLEPc.
>
>
> I manually distribute a sparse matrix across several CPUs and everything
> works fine when:
>
> - I do _not_ use harmonic extraction
>
> - I use harmonic extraction on only a single CPU
>
>
> If I try do use harmonic extraction on multiple CPUs, I get a memory
> corruption.
>
> I'm not quite sure where to look at, but somewhere in the output, I find:
>
>
>
> [1]PETSC ERROR: PetscMallocValidate: error detected at
> PetscSignalHandlerDefault() line 145 in
> /home/applications/sources/libraries/petsc-3.9.3/src/sys/error/signal.c
> [1]PETSC ERROR: Memory [id=0(9072)] at address 0x145bcd0 is corrupted
> (probably write past end of array)
> [1]PETSC ERROR: Memory originally allocated in DSAllocateWork_Private()
> line 74 in
> /home/applications/sources/libraries/slepc-3.9.2/src/sys/classes/ds/interface/dspriv.c
>
>
> Now, I have the feeling that this might be a bug in SLEPc because, if I
> had messed up the matrix initialization and distribution, I should also get
> a memory corruption when I don't use harmonic extraction, right?
>

Not necessarily


> Any suggestions what might be going on?
>

Run your code through valgrind and make sure that your application code is
clean. See here

http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind

If errors are detected in your application code, fix them and see if the
slepc errors go away. If your code is valgrind clean, send through the
relevant chunk of the valgrind report indicating exactly where the error is
occurring

Thanks,
  Dave



> Regards,
>
> Moritz
>
>
>
>
>
>
>
>


[petsc-users] memory corruption when using harmonic extraction with SLEPc

2018-08-02 Thread Moritz Cygorek
Hi,


I want to diagonalize a huge sparse matrix and I'm using the Kryov-Schur method 
with harmonic extraction (command line option -eps_harmonic ) implemented in 
SLEPc.


I manually distribute a sparse matrix across several CPUs and everything works 
fine when:

- I do _not_ use harmonic extraction

- I use harmonic extraction on only a single CPU


If I try do use harmonic extraction on multiple CPUs, I get a memory corruption.

I'm not quite sure where to look at, but somewhere in the output, I find:



[1]PETSC ERROR: PetscMallocValidate: error detected at 
PetscSignalHandlerDefault() line 145 in 
/home/applications/sources/libraries/petsc-3.9.3/src/sys/error/signal.c
[1]PETSC ERROR: Memory [id=0(9072)] at address 0x145bcd0 is corrupted (probably 
write past end of array)
[1]PETSC ERROR: Memory originally allocated in DSAllocateWork_Private() line 74 
in 
/home/applications/sources/libraries/slepc-3.9.2/src/sys/classes/ds/interface/dspriv.c



Now, I have the feeling that this might be a bug in SLEPc because, if I had 
messed up the matrix initialization and distribution, I should also get a 
memory corruption when I don't use harmonic extraction, right?

Any suggestions what might be going on?


Regards,

Moritz