VecSetPreallocationCOO#

set preallocation for a vector using a coordinate format of the entries with global indices

Synopsis#

#include "petscvec.h"   
PetscErrorCode VecSetPreallocationCOO(Vec x, PetscCount ncoo, const PetscInt coo_i[])

Collective

Input Parameters#

  • x - vector being preallocated

  • ncoo - number of entries

  • coo_i - entry indices

Notes#

This and VecSetValuesCOO() provide an alternative API to using VecSetValues() to provide vector values.

This API is particularly efficient for use on GPUs.

Entries can be repeated, see VecSetValuesCOO(). Negative indices are not allowed unless vector option VEC_IGNORE_NEGATIVE_INDICES is set, in which case they, along with the corresponding entries in VecSetValuesCOO(), are ignored. If vector option VEC_NO_OFF_PROC_ENTRIES is set, remote entries are ignored, otherwise, they will be properly added or inserted to the vector.

The array coo_i[] may be freed immediately after calling this function.

See Also#

Vectors and Parallel Data, Vec, VecSetValuesCOO(), VecSetPreallocationCOOLocal()

Level#

beginner

Location#

src/vec/vec/interface/vector.c

Implementations#

VecSetPreallocationCOO_MPIKokkos() in src/vec/vec/impls/mpi/kokkos/mpikok.kokkos.cxx
VecSetPreallocationCOO_MPI() in src/vec/vec/impls/mpi/pdvec.c
VecSetPreallocationCOO_Seq() in src/vec/vec/impls/seq/bvec2.c
VecSetPreallocationCOO_SeqKokkos() in src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx


Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages