/************* ** ** Dense Cholesky Factorization using block striped mapping ** ** ** N is the number of unknowns (ie. the input matrix should be N x N) ** NR is the number of rows per processor (ie. N / S == # of processors) ** ** Note: compile with -lm ** Adapted for Parsec 1.0 on 9-5-97 by Monnica Terwilliger ** **************/ #include #include #define INPUT_FILE "in.matrix" #define OUTPUT_FILE "out.matrix" #define N 6 /* # of unknown */ #define NR 1 /* # of rows per block */ #define NP N/NR /* # of processors (blocks) */ message Answer {int k; float row[N];}; message Link { ename prev; ename next; ename main;}; message Start { }; message End { }; message Eliminator { int k; float row[N];}; message Init_row { int k; float row[N];}; entity processor (int myid); struct indx_row { int k; float row[N]; }; entity driver (int argc, char **argv) { FILE *fp[2]; int i,j; float temp, A[N][N]; ename p_id[N]; if ((fp[0] = fopen (INPUT_FILE, "r")) == NULL) { fputs("error opening the input file\n",stderr); pc_exit(1); } for (i=0; ij) A[i][j] = 0.0; else A[i][j] = temp; } fclose (fp[0]); /** create the processors **/ for (i=0; i