petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscGatherMessageLengths2

Computes info about messages that a MPI-node will receive, including (from-id,length) pairs for each message. Same functionality as PetscGatherMessageLengths() except it takes TWO ilenths and output TWO olengths.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscGatherMessageLengths2(MPI_Comm comm,PetscMPIInt nsends,PetscMPIInt nrecvs,const PetscMPIInt ilengths1[],const PetscMPIInt ilengths2[],PetscMPIInt **onodes,PetscMPIInt **olengths1,PetscMPIInt **olengths2)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - Communicator Many br
| nsends | - number of messages that are to be sent. Many br
| nrecvs | - number of messages being received Many br
| ilengths1, ilengths2 | - array of integers of length sizeof(comm) Many bra non zero ilengths[i] represent a message to i of length ilengths[i] Many br

### Output Parameters

| onodes | - list of node-ids from which messages are expected Many br
| olengths1, olengths2 | - corresponding message lengths Many br

Many br

### Notes

With this info, the correct MPI_Irecv() can be posted with the correct Many brfrom-id, with a buffer with the right amount of memory required. Many br

The calling function deallocates the memory in onodes and olengths Many br

To determine nrecevs, one can use PetscGatherNumberOfMessages() Many br

### See Also

PetscGatherMessageLengths() and PetscGatherNumberOfMessages()

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