Re: [petsc-dev] MatCreateVecs interface
On Jun 25, 2015, at 6:38 PM, Matthew Knepley <[email protected]> wrote:
On Thu, Jun 25, 2015 at 12:32 PM, Stefano Zampini <[email protected]> wrote: pushed a fix https://bitbucket.org/petsc/petsc/commits/ae287a2e7a141494f7c41f9dd537addb63...
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 <[email protected]> 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 <[email protected]> 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
participants (1)
-
Stefano Zampini