[petsc-users] Newbie Question - Really slow - PetscMemCpy
Parker, Andrew (UK Filton)
Andrew.Parker2 at baesystems.com
Thu Apr 22 09:15:12 CDT 2010
Well that's a worry, no error from:
MatSetOption(_storage,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE);
Still slow as hell, same behaviour as before. I'm now using:
MatCreate(PETSC_COMM_SELF,&_storage);
MatSetType(_storage, MATSEQBAIJ);
MatSetOption(_storage,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE);
MatSetSizes(_storage,PETSC_DECIDE,PETSC_DECIDE,numVars*numLocs,numVars*n
umLocs);
MatSetFromOptions(_storage);
MatSeqBAIJSetPreallocation(_storage,numVars,PETSC_NULL,sparsityStart);
So it has to be the sparsity, but then wouldn't that have thrown and
error? And I can't have really messed that up, just number of neighbour
cells plus myself for each row?
Might try adding other error codes, would it only throw when attached to
a debugger or will it throw in optimised or standard debug? Watching it
in Top, it just allocates and deallocates like mad.
Cheers,
Andy
-----Original Message-----
From: petsc-users-bounces at mcs.anl.gov
[mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Barry Smith
Sent: 22 April 2010 14:48
To: PETSc users list
Subject: Re: [petsc-users] Newbie Question - Really slow - PetscMemCpy
*** WARNING ***
This message has originated outside your organisation,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.
On Apr 22, 2010, at 7:56 AM, Jed Brown wrote:
> On Thu, 22 Apr 2010 13:33:42 +0100, "Parker, Andrew (UK Filton)"
> <Andrew.Parker2 at baesystems.com
> > wrote:
>> I'm using Seq_BAIJ. My bets are that I've got the sparsity wrong, or
>> the preallocation wrong, but I'm not sure why.
>
> You are almost certainly correct. You can
>
> MatSetOption(A,MAT_NEW_NONZERO_ALLOCATION_ERROR,PETSC_TRUE);
>
> to get the debugger to break on the first entry that you have not
> preallocated. Then you can trace the index back through the stack to
> the application.
>
> Barry et al, why isn't this available as a runtime option?
Good suggestion. Now the question is do we put it in the "right"
place which is MatSetFromOptions(), but most people never call
MatSetFromOptions() so should we put in the "ideological wrong place"
MatCreate() since that means it will always be available?
Barry
>
>> I set up the matrix like this
>>
>> MatCreate(PETSC_COMM_SELF,&_storage);
>>
>> MatSetSizes
>> (_storage,PETSC_DECIDE,PETSC_DECIDE,numVars*numLocs,numVars*n
>> umLocs);
>> MatSetFromOptions(_storage);
>>
>> MatSeqBAIJSetPreallocation
>> (_storage,numVars,PETSC_NULL,sparsityStart);
>>
>> However, using this makes zero difference to the speed
>>
>> MatCreateSeqBAIJ(PETSC_COMM_SELF,
>> numVars,
>> numVars*numLocs,
>> numVars*numLocs,
>> 0,
>> sparsityStart,
>> &_storage);
>
> These two calls do the same thing underneath, the former is more
> flexible and takes options from the command line.
>
>> It is so slow that it has not even completed one cycle of the
>> solver....
>
> That will change when the preallocation is fixed.
>
> Jed
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
More information about the petsc-users
mailing list