Gaussian elimination with partial pivoting

81 阅读2分钟

In Assignment 2, you need to tackle the programming tasks as described below using C/C++ and MPI. You also need to write a report on your work. Gaussian elimination with partial pivoting is a technique used to solve a system of linear equations. It adds multiples of each row to later rows to transform the matrix into triangular matrices L and U. Partial pivoting technique is applied to make the algorithm stable; that is, in each elimination iteration, rows are swapped so that the leading element A(i,i) is the largest in the leading column to prevent division by zero. A serial pseudocode is given below. // Gaussian elimination with partial pivoting for (i=0; i<n-1; i++) //find and record k where |A(k,i)|=A(j,i)| if (|A(k,i)|== 0) //exit with a warning that A is singular, or nearly so else if (k != i) //swap row i and row k of A //store multiplier in place of A(j,i) for (j=i+1; j<n; j++) A[j][i] = A[j][i] / A[i][i]; //now each |quotient|≤ 1 //subtract multiple of row A(i,:) to zero out A(j,i) for (j=i+1; j<n; j++) for (k=i+1; k<n; k++) A[j][k] −= A[j][i] * A[i][k]; In distributed memory machines data need to be partitioned and distributed to processes. In this assignment you need to use Column block cyclic partitioning for data distribution. In your implementation: • Processes are organized as a one dimensional, or 1D array; • Column block cyclic partitioning must be adopted for the data distribution; • You need to write two MPI programs: one without loop unrolling, and the other with loop unrol 代 写Gaussian elimination with partial pivoting ling added to improve the performance: o In the program without loop unrolling the block size b in column block cyclic partitioning must be a variable to handle different block sizes asked by the user. Then your program needs to ask for matrix size N and block size b as two userdefined input parameters; o In the program with loop unrolling, the block size b in column block cyclic partitioning is fixed and set to 8, and the loop unrolling factor is set to 4 to simplify the implementation. Then your program needs to ask for matrix size N as one user-defined input parameter. • You must submit both programs! They will be marked separately. • You must use derived datatypes for process communication for the purposes of efficiency and readability; • Your main programs must conduct a self-check for correctness; i.e., compare the results of a basic Gaussian elimination with partial pivoting as done in gepp_0.c and your parallel computing procedure with the same input data set. Your programs must be able to compile and run on Microsoft Azure Virtual Machines. Report: You must write a report. The report should be concise, clear (3-6 A4 pages) and contain the following sections:

  1. Problem definition and requirements
  2. Algorithm design and implementation
  3. Testing
  4. Discussion
  5. Known issues in you program
  6. Manual (e.g. how to compile and run the program, input and output) Your assignments will be marked on correctness of results, the efficiency of your algorithm, program logic and readability, and quality of your report. You MUST attempt this assignment individually. AI use policy: You are permitted to use Artificial Intelligence (AI) tools to help you develop your programs and write your report. You are required to complete and submit the “Acknowledgement of AI Use Form”, even if you do not use AI tools at all. You will not lose marks for using AI tools as long as you correctly acknowledge your use of them. Submission Requirements
  7. Your submission must be made by 11:59pm on Friday, 24 May, 2024 (Sydney time).
  8. Create a tar or zip file that contains your makefile and source files (e.g., .c and .h files) and “Acknowledgement of AI Use Form”. DO NOT INCLUDE ANY OBJECT OR BINARY FILES. • Submit only one .tar or .zip file to the “Assignment 2 code submission inbox”.
  9. Save your report in pdf format. • Submit your report to the “Assignment 2 report submission inbox”. Failure to follow these submission requirements may lead to loss of marks. WX:codinghelp