Skip to main content
`Ctrl`+`K`

# PetscPostIrecvScalar

Allocate the receive buffers for an irregular all-to-all of `PetscScalar` messages and post non-blocking `MPI_Irecv()`s on them

## Synopsis

    #include "petscsys.h"
    PetscErrorCode PetscPostIrecvScalar(MPI_Comm comm, PetscMPIInt tag, PetscMPIInt nrecvs, const PetscMPIInt onodes[], const PetscMPIInt olengths[], PetscScalar ***rbuf, MPI_Request **r_waits)

Collective; No Fortran Support

## Input Parameters

- comm - the `MPI_Comm` to communicate over

- tag - MPI tag for the irecvs

- nrecvs - number of receives to post

- onodes - array of length `nrecvs` of source ranks

- olengths - array of length `nrecvs` of message lengths (in `PetscScalar`s)

## Output Parameters

- rbuf - allocated array of length `nrecvs` of pointers to the receive buffers (in contiguous storage)

- r_waits - allocated array of length `nrecvs` of `MPI_Request`s for the posted irecvs

## Note

The caller is responsible for freeing `rbuf[0]`, `rbuf`, and `r_waits` with `PetscFree()` once the irecvs have completed.

## See Also

`PetscPostIrecvInt()`, `PetscGatherNumberOfMessages()`, `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