A simple MPI program to calculates infinity norm of a matrix using row-wise block-striped partitioning.
A matrix norm is a number defined in terms of the entries of the matrix. The norm is a useful quantity which can give important information about a matrix. The infinity norm of a matrix is defined to be the maximum of sums of absolute values of elements in a row, over all rows.
we sum the absolute values along each row and then take the biggest answer.
A =
[ 1 −7 ]
[-2 −3 ]
Infinity Norm = 8.
The idea is that the matrix m x n is striped among p processors so that each processors stores m/p rows of the matrix. A typical column-wise and row-wise partitioning of the matrix
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
CPU(s): 8
Thread(s) per core: 2
$ mpic++ main.cpp -o exc
$ mpirun -np 4 exc < input.txt