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

PetscCommBuildTwoSided

discovers communicating ranks given one-sided information, moving constant-sized data in the process (often message lengths)

Synopsis

#include "petscsys.h"  
PetscErrorCode PetscCommBuildTwoSided(MPI_Comm comm,PetscMPIInt count,MPI_Datatype dtype,PetscMPIInt nto,const PetscMPIInt *toranks,const void *todata,PetscMPIInt *nfrom,PetscMPIInt **fromranks,void *fromdata)
Collective on MPI_Comm Many br

Input Arguments

comm - communicator Many br
count - number of entries to send/receive (must match on all ranks) Many br
dtype - datatype to send/receive from each rank (must match on all ranks) Many br
nto - number of ranks to send data to Many br
toranks - ranks to send to (array of length nto) Many br
todata - data to send to each rank (packed) Many br

Output Arguments

nfrom - number of ranks receiving messages from Many br
fromranks - ranks receiving messages from (length nfrom; caller should PetscFree()) Many br
fromdata - packed data from each rank, each with count entries of type dtype (length nfrom, caller responsible for PetscFree()) Many br

Many br

Options Database Keys

-build_twosided <allreduce|ibarrier|redscatter> -algorithm to set up two-sided communication Many br

Notes

This memory-scalable interface is an alternative to calling PetscGatherNumberOfMessages() and Many brPetscGatherMessageLengths(), possibly with a subsequent round of communication to send other constant-size data. Many br

Basic data types as well as contiguous types are supported, but non-contiguous (e.g., strided) types are not. Many br

References

1. -Hoefler, Siebert and Lumsdaine, The MPI_Ibarrier implementation uses the algorithm in Many brScalable communication protocols for dynamic sparse data exchange, 2010. Many br

See Also

PetscGatherNumberOfMessages(), PetscGatherMessageLengths()

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