Gather the values from each process in the non-root group into an array of values at the root process. On the root process, the pth element of the result will be equal to the value parameter of the process with rank p in the other group when this routine returns.

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


public T[] Gather<T>(
	T value,
	int root
Visual Basic (Declaration)
Public Function Gather(Of T) ( _
	value As T, _
	root As Integer _
) As T()
Visual C++
generic<typename T>
array<T>^ Gather(
	T value, 
	int root


Type: T
The value contributed by this process. Only significant at non-root group processes.
Type: System..::.Int32
Used to indicate the process gathering the data. At the root, should be Root. At leaf group processes should be the rank of the root process in the root group. At non-root processes in the root group, should be Null.

Type Parameters

Any serializable type.

Return Value

At the root, an array containing the values supplied by each of the processes in the non-root group. All other processes receive null.

See Also