# PetscGatherNumberOfMessages

Computes the number of messages a node expects to receive

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscGatherNumberOfMessages(MPI_Comm comm,PetscMPIInt *iflags,PetscMPIInt *ilengths,PetscMPIInt *nrecvs)

Collective on MPI_Comm

### Input Parameters

| comm | - Communicator
| iflags | - an array of integers of length sizeof(comm). A '1' in ilengths[i] represent a message from current node to ith node. Optionally PETSC_NULL
| ilengths | - Non zero ilengths[i] represent a message to i of length ilengths[i]. Optionally PETSC_NULL.

### Output Parameters

nrecvs -number of messages received

### Notes

With this info, the correct message lengths can be determined using PetscGatherMessageLengths()

Either iflags or ilengths should be provided. If iflags is not provided (PETSC_NULL) it can be computed from ilengths. If iflags is provided, ilengths is not required.

### See Also

PetscGatherMessageLengths()

Level:developer
Location:src/sys/utils/mpimesg.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages