Actual source code: pvec2.c


  2: /*
  3:      Code for some of the parallel vector primitives.
  4: */
  5: #include <../src/vec/vec/impls/mpi/pvecimpl.h>
  6: #include <petscblaslapack.h>

  8: PetscErrorCode VecDot_MPI(Vec xin, Vec yin, PetscScalar *z)
  9: {
 10:   PetscFunctionBegin;
 11:   PetscCall(VecXDot_MPI_Default(xin, yin, z, VecDot_Seq));
 12:   PetscFunctionReturn(PETSC_SUCCESS);
 13: }

 15: PetscErrorCode VecTDot_MPI(Vec xin, Vec yin, PetscScalar *z)
 16: {
 17:   PetscFunctionBegin;
 18:   PetscCall(VecXDot_MPI_Default(xin, yin, z, VecTDot_Seq));
 19:   PetscFunctionReturn(PETSC_SUCCESS);
 20: }

 22: PetscErrorCode VecMDot_MPI(Vec xin, PetscInt nv, const Vec y[], PetscScalar *z)
 23: {
 24:   PetscFunctionBegin;
 25:   PetscCall(VecMXDot_MPI_Default(xin, nv, y, z, VecMDot_Seq));
 26:   PetscFunctionReturn(PETSC_SUCCESS);
 27: }

 29: PetscErrorCode VecMTDot_MPI(Vec xin, PetscInt nv, const Vec y[], PetscScalar *z)
 30: {
 31:   PetscFunctionBegin;
 32:   PetscCall(VecMXDot_MPI_Default(xin, nv, y, z, VecMTDot_Seq));
 33:   PetscFunctionReturn(PETSC_SUCCESS);
 34: }

 36: PetscErrorCode VecNorm_MPI(Vec xin, NormType type, PetscReal *z)
 37: {
 38:   PetscFunctionBegin;
 39:   PetscCall(VecNorm_MPI_Default(xin, type, z, VecNorm_Seq));
 40:   PetscFunctionReturn(PETSC_SUCCESS);
 41: }

 43: PetscErrorCode VecMax_MPI(Vec xin, PetscInt *idx, PetscReal *z)
 44: {
 45:   const MPI_Op ops[] = {MPIU_MAXLOC, MPIU_MAX};

 47:   PetscFunctionBegin;
 48:   PetscCall(VecMinMax_MPI_Default(xin, idx, z, VecMax_Seq, ops));
 49:   PetscFunctionReturn(PETSC_SUCCESS);
 50: }

 52: PetscErrorCode VecMin_MPI(Vec xin, PetscInt *idx, PetscReal *z)
 53: {
 54:   const MPI_Op ops[] = {MPIU_MINLOC, MPIU_MIN};

 56:   PetscFunctionBegin;
 57:   PetscCall(VecMinMax_MPI_Default(xin, idx, z, VecMin_Seq, ops));
 58:   PetscFunctionReturn(PETSC_SUCCESS);
 59: }