Actual source code: vmpicr.c

      1: #define PETSCVEC_DLL
      2: /*
      3:    This file contains routines for Parallel vector operations.
      4:  */

     6:  #include src/vec/impls/mpi/pvecimpl.h

     10: /*@C
     11:    VecCreateMPI - Creates a parallel vector.

     13:    Collective on MPI_Comm
     14:
     15:    Input Parameters:
     16: +  comm - the MPI communicator to use
     17: .  n - local vector length (or PETSC_DECIDE to have calculated if N is given)
     18: -  N - global vector length (or PETSC_DETERMINE to have calculated if n is given)

     20:    Output Parameter:
     21: .  vv - the vector

     23:    Notes:
     24:    Use VecDuplicate() or VecDuplicateVecs() to form additional vectors of the
     25:    same type as an existing vector.

     27:    Level: intermediate

     29:    Concepts: vectors^creating parallel

     31: .seealso: VecCreateSeq(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(),
     32:           VecCreateMPIWithArray(), VecCreateGhostWithArray()

     34: @*/
     35: PetscErrorCode PETSCVEC_DLLEXPORT VecCreateMPI(MPI_Comm comm,PetscInt n,PetscInt N,Vec *v)
     36: {

     40:   VecCreate(comm,v);
     41:   VecSetSizes(*v,n,N);
     42:   VecSetType(*v,VECMPI);
     43:   return(0);
     44: }