[petsc-dev] Weird interaction between VecDuplicate and VecSetBlockSize

Barry Smith bsmith at mcs.anl.gov
Mon Apr 9 15:40:34 CDT 2012


On Apr 9, 2012, at 2:20 PM, Lisandro Dalcin wrote:

> On 9 April 2012 21:18, Barry Smith <bsmith at mcs.anl.gov> wrote:
>> 
>> On Mar 30, 2012, at 12:44 PM, Lisandro Dalcin wrote:
>> 
>>> On 30 March 2012 19:34, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>>> 
>>>> On Mar 30, 2012, at 11:07 AM, Lisandro Dalcin wrote:
>>>> 
>>>>> On 30 March 2012 19:00, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>>> 
>>> Are you sure? How are we going to support the usage below?:
>>> 
>>> VecCreateSeq(comm,n,&vec)
>>> VecSetBlockSize(vec,bs)
>> 
>>    This is not longer supported. If you wish to set the blocksize of a vector you cannot use the convenience routines VecCreateSeq() or VecCreateMPI(). Nor can you can a Vec block size later.
>> 
> 
> Not that I'm asking for it, but have you considered
> VecCreateSeq(comm,bs,n,&vec) and VecCreateMPI(comm,&bs,n,N,&vec) ?
> VecCreateXXXWithArray() was changed to take the block size...

   I considered that. The justification for changing the WithArray() is because there is no other way to set the block size (one cannot use VecCreate,VecSetSizes,.... ) and they are not commonly used while the VecCreateSeq() are commonly used so changing them will affect a lot of people and one can always use VecCreate, VecSetSizes,VecSetBlockSize, VecSetType.

    I am open to arguing about what the best interface is ...   That is I am not claiming my decision is infallible.

   Barry

> 
> 
> 
> -- 
> Lisandro Dalcin
> ---------------
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169




More information about the petsc-dev mailing list