Consider the following code. Each process has two buffers sendata and recvdata. senddata is initialized with the rank of the respective processes. Fill the blank space with the routine to perform prefix reduction such that the ouput is : code example
Example: build a prefix array cpp
void fillPrefixSum(int arr[], int n, int prefixSum[])
{
prefixSum[0] = arr[0];
// Adding present element
// with previous element
for (int i = 1; i < n; i++)
prefixSum[i] = prefixSum[i - 1] + arr[i];
}