[petsc-users] New nonzero caused a malloc

Matthew Knepley knepley at gmail.com
Thu Apr 4 16:02:08 CDT 2013


On Fri, Apr 5, 2013 at 7:05 AM, George Pau <gpau at lbl.gov> wrote:

> Hi
>
> Just a follow up on the previous email which was sent accidentally.  The
> info during assembly indicates there is no mallocs (typo in previous
> email).  In addition, mncon is 18 and so the total nonzero column blocks
> per row block is greater than the nonzero blocks shown.  If I use a single
> processor, I do not see the above error.
>

Then this is likely you are not dividing the nonzeros between the diagonal
and off-diagonal blocks correctly.

    Matt


> Thanks,
> George
>
>
>
> On Thu, Apr 4, 2013 at 1:01 PM, George Pau <gpau at lbl.gov> wrote:
>
>> Hi,
>>
>> I am trying to determine where there is malloc when I am doing a
>> MatSetValuesBlocked.  The following is the error:
>>
>> [1]PETSC ERROR: --------------------- Error Message
>> ------------------------------------
>> [1]PETSC ERROR: Argument out of range!
>> [1]PETSC ERROR: New nonzero at (69216,95036) caused a malloc!
>>
>> However, when I look at the info during the assembly, I have
>>
>> [0] MatAssemblyBegin_MPIBAIJ(): Stash has 0 entries,uses 0 mallocs.
>> [0] MatAssemblyBegin_MPIBAIJ(): Block-Stash has 0 entries, uses 0 mallocs.
>> [1] MatAssemblyEnd_SeqBAIJ(): Matrix size: 381300 X 381300, block size 4;
>> storage space: 14143776 unneeded, 10259424 used
>> [1] MatAssemblyEnd_SeqBAIJ(): Number of mallocs during MatSetValues is 0
>> [1] MatAssemblyEnd_SeqBAIJ(): Most nonzeros blocks in any row is 16
>> [0] MatAssemblyEnd_SeqBAIJ(): Matrix size: 381300 X 381300, block size 4;
>> storage space: 13696176 unneeded, 10707024 used
>> [0] MatAssemblyEnd_SeqBAIJ(): Number of mallocs during MatSetValues is 0
>> [0] MatAssemblyEnd_SeqBAIJ(): Most nonzeros blocks in any row is 11
>>
>> which indicates there is mallocs.
>>
>> The following is how I set up the matrix:
>>
>> call MatCreate(PETSC_COMM_WORLD,petsc_obj%jacmat, pierr)
>> call
>> MatSetSizes(petsc_obj%jacmat,PETSC_DECIDE,PETSC_DECIDE,nel*neq,nel*neq,pierr)
>> call MatSetFromOptions(petsc_obj%jacmat,pierr)
>> call MatSetBlockSize(petsc_obj%jacmat,neq,pierr)
>> call MatSetType(petsc_obj%jacmat,MATBAIJ,pierr)
>> call
>> MatSeqBAIJSetPreallocation(petsc_obj%jacmat,neq,(mncon+1)*neq*neq,PETSC_NULL_INTEGER,pierr)
>> call MatMPIBAIJSetPreallocation(petsc_obj%jacmat,
>> neq,neq*neq,PETSC_NULL_INTEGER,mncon*neq*neq,PETSC_NULL_INTEGER,pierr)
>>     call
>> MatSetOption(petsc_obj%jacmat,MAT_ROW_ORIENTED,PETSC_FALSE,pierr) !because
>> of how aval is stored.
>>
>> --
>> George Pau
>> Earth Sciences Division
>> Lawrence Berkeley National Laboratory
>> One Cyclotron, MS 74-120
>> Berkeley, CA 94720
>>
>> (510) 486-7196
>> gpau at lbl.gov
>> http://esd.lbl.gov/about/staff/georgepau/
>>
>
>
>
> --
> George Pau
> Earth Sciences Division
> Lawrence Berkeley National Laboratory
> One Cyclotron, MS 74-120
> Berkeley, CA 94720
>
> (510) 486-7196
> gpau at lbl.gov
> http://esd.lbl.gov/about/staff/georgepau/
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130405/6b56927b/attachment.html>


More information about the petsc-users mailing list