/************************************************************ File: cholesky_slave.cc Description: A program that inputs a matrix from a file and computes the Cholesky decomposition using several processes. Author: Dana Vrajitoru Organization: IUSB Date: August 16, 2002 **************************************************************/ #include #include #include #include #include "cholesky_slave.h" #include "common.h" // The core function that computes the Cholesky decomposition. void Compute_cholesky(int proc_id, int proc_number) { int l, k, size=proc_number-1, col = proc_id-1; float x, *ai, ak, *a_proc; ai = new float[size]; a_proc = new float[size]; Receive_float_array(MASTER_ID, a_proc, size); for (l=0; l<=2*size-2; l++) { if ((l<=2*col) && (col <= min(l, size-1))) { x = a_proc[l-col]; if (l != 2*col) Receive_float_array(l-col+1, ai, l-col+1); for (k=0; k