/********************************************************** File: main.cc Description: A program that computes an integral with several processes. Author: Dana Vrajitoru Organization: IUSB Date: July 19, 2002 ***********************************************************/ #include #include #include using namespace std; #include "cholesky_master.h" #include "cholesky_slave.h" #include "common.h" // The main function int main(int argc, char **argv) { int proc_id, nb_proc, n; /* Initialize MPI */ MPI_Init (&argc, &argv); /* Get the rank of this process */ MPI_Comm_rank (MPI_COMM_WORLD, &proc_id); /* Get nb of processes */ MPI_Comm_size (MPI_COMM_WORLD, &nb_proc); if (proc_id == MASTER_ID) Master(nb_proc); else Compute_cholesky(proc_id, nb_proc); /* Finalize MPI */ MPI_Finalize (); return 0; } // End of the program