Reduce is a collective algorithm that combines the values supplied by each process in the leaf group into a single value available at the designated root process. The values are combined in a user-defined way, specified via a delegate. If value1, value2, ..., valueN are the values provided by the N processes in the communicator, the result will be the value value1 op value2 op ... op valueN. This result is only available to the root process. If all processes need the result of the reduction, use Allreduce<(Of <(T>)>)(T, ReductionOperation<(Of <(T>)>)).

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


public T Reduce<T>(
	T value,
	ReductionOperation<T> op,
	int root
Visual Basic (Declaration)
Public Function Reduce(Of T) ( _
	value As T, _
	op As ReductionOperation(Of T), _
	root As Integer _
) As T
Visual C++
generic<typename T>
T Reduce(
	T value, 
	ReductionOperation<T>^ op, 
	int root


Type: T
The local value that will be combined with the values provided by other leaf group processes.
Type: MPI..::.ReductionOperation<(Of <(T>)>)
The operation used to combine two values. This operation must be associative.
Type: System..::.Int32
The rank of the process that is the root of the reduction operation, which will receive the result of the reduction operation in its outValue argument.

Type Parameters

Any serializable type.

Return Value

On the root, returns the result of the reduction operation. The other processes receive a default value.

See Also