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


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


Input Parameters#

  • comm - Communicator

  • nsends - number of messages that are to be sent.

  • nrecvs - number of messages being received

  • ilengths1 - first array of integers of length sizeof(comm)

  • ilengths2 - second array of integers of length sizeof(comm)

Output Parameters#

  • onodes - list of ranks from which messages are expected

  • olengths1 - first corresponding message lengths

  • olengths2 - second message lengths


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

The calling function should PetscFree() the memory in onodes and olengths

To determine nrecvs, one can use PetscGatherNumberOfMessages()

See Also#

PetscGatherMessageLengths(), PetscGatherNumberOfMessages(), PetscCommBuildTwoSided()





Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages