VecNormAvailable#
Returns the vector norm if it is already known. That is, it has been previously computed and cached in the vector
Synopsis#
#include "petscvec.h"
PetscErrorCode VecNormAvailable(Vec x, NormType type, PetscBool *available, PetscReal *val)
Not Collective
Input Parameters#
x - the vector
type - one of
NORM_1
(sum_i |x[i]|),NORM_2
sqrt(sum_i (x[i])^2),NORM_INFINITY
max_i |x[i]|. Also availableNORM_1_AND_2
, which computes both norms and stores them in a two element array.
Output Parameters#
available -
PETSC_TRUE
if the val returned is validval - the norm
Performance Issues#
per-processor memory bandwidth
interprocessor latency
work load imbalance that causes certain processes to arrive much earlier than others
Developer Note#
PETSC_HAVE_SLOW_BLAS_NORM2
will cause a C (loop unrolled) version of the norm to be used, rather
than the BLAS. This should probably only be used when one is using the FORTRAN BLAS routines
(as opposed to vendor provided) because the FORTRAN BLAS NRM2()
routine is very slow.
See Also#
Vectors and Parallel Data, Vec
, VecDot()
, VecTDot()
, VecNorm()
, VecDotBegin()
, VecDotEnd()
,
VecNormBegin()
, VecNormEnd()
Level#
intermediate
Location#
src/vec/vec/interface/rvector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages