matrix multipilation with mpi

The objective of the project is to perform matrix multiplication using the parallel computing
frameworks : MPI
File Formats
The program must be standard as follows:
• There are two input files. File 1 contains matrix 1, file 2 contains matrix 2. There is one output
file, containing the output matrix.
• Each of these files follows a standard format: At the beginning of the file there is the size of the
square matrix, followed by a tab, then all the matrix elements row by row separated by a tab.
Example:
This matrix:
1.1 2.3 4.5
8.0 9 4. 4
2.5 7.0 6.8
should be saved in a file as follows:
3 1.1 2.3 4.5 8.0 9 4.4 2.5 7.0 6.8


i have the source code of (matrix multipilation with mpi ) it run very good with static matrices (2d arrays with fixed size),but i want the array of matrix is dynamic , plz i want in codeing , the code of static matrices attached




http://www.mediafire.com/?9ffbax294dh192i


Last edited on
just so that you know, a good place to put your code if there is too much to post here is pastebin.com

anyway,
for matrices use one dimensional dynamic arrays. note that your matrices will be square (written in the task description).
example:
1
2
3
in n = size of the matrix read from the file
double* matrix = (double*)calloc(n*n, sizeof(double));
for(int i = 0; i < n*n; i++) read matrix[i] from the file.

the rest will remain quite similar. just change stuff like &c[offset][0] to c+offset*n, I think..
Last edited on
Topic archived. No new replies allowed.