matrix multiplication using Mpi_Scatter and Mpi_Gather
I newbie to mpi programming. I was trying to write matrix multiplication. Went through the post MPI Matrix Multiplication with scatter gather about matrix multiplication using scatter and gather routine. I tried modifying the code available on above post as below... #define N 4 #include <stdio.h> #include <math.h> #include <sys/time.h> #include <stdlib.h> #include <stddef.h> #include "mpi.h" void print_results(char *prompt, int a[N][N]); int main(int argc, char *argv[]) { int i, j, k, rank, size, tag = 99, blksz, sum = 0; int a[N][N]={{1,2,3,4},{5,6,7,8},{9,1,2,3},{4,5,6,7,}}; int b[N][N]={{1