1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/MPIU_Allreduce.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>MPIU_Allreduce</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.14.5 2021-03-03</b></div>
<div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.14.5 v3.14.5 docs/manualpages/Sys/MPIU_Allreduce.html "><small>Report Typos and Errors</small></a></div>
<A NAME="MPIU_Allreduce"><H1>MPIU_Allreduce</H1></A>
a PETSc replacement for MPI_Allreduce() that tries to determine if the call from all the MPI processes occur from the same place in the PETSc code. This helps to detect bugs where different MPI processes follow different code paths resulting in inconsistent and incorrect calls to MPI_Allreduce(). Collective
<P>
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include <petscsys.h>
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> <A HREF="../Sys/MPIU_Allreduce.html#MPIU_Allreduce">MPIU_Allreduce</A>(void *indata,void *outdata,<A HREF="../Sys/PetscMPIInt.html#PetscMPIInt">PetscMPIInt</A> count,MPI_Datatype datatype, MPI_Op op, <A HREF="../Sys/MPI_Comm.html#MPI_Comm">MPI_Comm</A> comm);
</PRE>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>indata </B></TD><TD>- pointer to the input data to be reduced
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>count </B></TD><TD>- the number of MPI data items in indata and outdata
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>datatype </B></TD><TD>- the MPI datatype, for example MPI_INT
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>op </B></TD><TD>- the MPI operation, for example MPI_SUM
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>comm </B></TD><TD>- the MPI communicator on which the operation occurs
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>outdata </B></TD><TD>- the reduced values
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
In optimized mode this directly calls MPI_Allreduce()
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
MPI_Allreduce()
<BR><P><B></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>developer<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../include/petscsys.h.html#MPIU_Allreduce">include/petscsys.h</A>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/ksp/ksp/tutorials/ex10.c.html">src/ksp/ksp/tutorials/ex10.c.html</A><BR>
<A HREF="../../../src/ts/utils/dmplexlandau/tutorials/ex2.c.html">src/ts/utils/dmplexlandau/tutorials/ex2.c.html</A><BR>
<BR><A HREF="./index.html">Index of all Sys routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|