Allreduce is a collective algorithm that combines the values stored by each process into a single value available to all processes. The values are combined in a user-defined way, specified via a delegate. When provided with arrays, Allreduce combines the ith value of each of the arrays passed to each process. Thus, Allreduce on arrays is the same as calling Allreduce<(Of <(T>)>)(T, ReductionOperation<(Of <(T>)>)) for each inValues[i]. An Allreduce is equivalent to a Reduce<(Of <(T>)>)(array<T>[]()[], ReductionOperation<(Of <(T>)>), Int32, array<T>[]()[]%) followed by a Broadcast<(Of <(T>)>)(array<T>[]()[]%, Int32).

Namespace:  MPI
Assembly:  MPI (in MPI.dll)
Version: (


public void Allreduce<T>(
	T[] inValues,
	ReductionOperation<T> op,
	ref T[] outValues
Visual Basic (Declaration)
Public Sub Allreduce(Of T) ( _
	inValues As T(), _
	op As ReductionOperation(Of T), _
	ByRef outValues As T() _
Visual C++
generic<typename T>
void Allreduce(
	array<T>^ inValues, 
	ReductionOperation<T>^ op, 
	array<T>^% outValues


Type: array< T >[]()[]
The local values that will be combined with the values provided by other processes.
Type: MPI..::.ReductionOperation<(Of <(T>)>)
The operation used to combine two values. This operation must be associative.
Type: array< T >[]()[] %
The values that result from combining all of the values in inValues element-by-element. If needed, this array will be resized to the same size as inValues. Supply this argument when you have pre-allocated space for the resulting array.

Type Parameters

Any serializable type.

See Also