[petsc-dev] MatCreateVecs interface

Stefano Zampini stefano.zampini at gmail.com
Thu Jun 25 12:47:02 CDT 2015


On Jun 25, 2015, at 6:38 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Thu, Jun 25, 2015 at 12:32 PM, Stefano Zampini <stefano.zampini at gmail.com> wrote:
> pushed a fix
> https://bitbucket.org/petsc/petsc/commits/ae287a2e7a141494f7c41f9dd537addb63b556e3
> 
> However, it appears that the functions below for CUSP, CUSPARSE and VIENNACL are mere copies of the interface.
> What  about defining the type of the Vec in the interface and get rid of these?
> 
> I think the point here is that the matrix should return Vecs of a compatible type, not a user specified one.
> 

I dont understand your point. If a specific getvecs implementation is not present, why not just testing for the type and return the correct Vec object in the interface, i.e. using VECCUSP instead of VECSTANDARD if the matrix is AIJCUSP?


>   Matt
>  
> src/mat/impls/aij/mpi/mpicusp/mpiaijcusp.cu:  A->ops->getvecs        = MatCreateVecs_MPIAIJCUSP;
> src/mat/impls/aij/mpi/mpicusparse/mpiaijcusparse.cu:  A->ops->getvecs        = MatCreateVecs_MPIAIJCUSPARSE;
> src/mat/impls/aij/mpi/mpiviennacl/mpiaijviennacl.cxx:  A->ops->getvecs        = MatCreateVecs_MPIAIJViennaCL;
> src/mat/impls/aij/seq/seqcusp/aijcusp.cu:  B->ops->getvecs        = MatCreateVecs_SeqAIJCUSP;
> src/mat/impls/aij/seq/seqcusparse/aijcusparse.cu:  B->ops->getvecs          = MatCreateVecs_SeqAIJCUSPARSE;
> src/mat/impls/aij/seq/seqviennacl/aijviennacl.cxx:  B->ops->getvecs        = MatCreateVecs_SeqAIJViennaCL;
> 
> Stefano
> 
> 
> On Jun 25, 2015, at 4:34 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>> 
>>  I think you are right, go ahead and make a pull request or send a patch
>> 
>>  Barry
>> 
>>> On Jun 25, 2015, at 9:43 AM, Stefano Zampini <stefano.zampini at gmail.com> wrote:
>>> 
>>> Why the current interface in MatCreateVecs requires that a matrix has been already either allocated or setup ?
>>> Shouldn’t be enough to check if the layout has been already setup?
>>> 
>>> Stefano
>>> 
>> 
> 
> 
> 
> 
> -- 
> 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-dev/attachments/20150625/6919a0ef/attachment.html>


More information about the petsc-dev mailing list