Question: Please only do question 5.5, and code in c code to be compiled in the current version of gcc. 5.4. Recall that when we solve

 Please only do question 5.5, and code in c code tobe compiled in the current version of gcc. 5.4. Recall that when

Please only do question 5.5, and code in c code to be compiled in the current version of gcc.

5.4. Recall that when we solve a large linear system, we often use Gaussian elimination followed by backward substitution. Gaussian elimination converts an nn linear system into an upper triangular linear system by using the "row operations." - Add a multiple of one row to another row - Swap two rows - Multiply one row by a nonzero constant An upper triangular system has zeroes below the "diagonal" extending from the upper left-hand corner to the lower right-hand corner. For example, the linear system 2x03x1=34x05x1+x2=72x0x13x2=5 can be reduced to the upper triangular form 2x03x1x1+x25x2=3=1,=0 and this system can be easily solved by first finding x2 using the last equation, then finding x1 using the second equation, and finally finding x0 using the first equation. We can devise a couple of serial algorithms for back substitution. The "roworiented" version is Here the "right-hand side" of the system is stored in array b, the twodimensional array of coefficients is stored in array A, and the solutions are stored in array x. An alternative is the following "column-oriented" algorithm: a. Determine whether the outer loop of the row-oriented algorithm can be parallelized. b. Determine whether the inner loop of the row-oriented algorithm can be parallelized. c. Determine whether the (second) outer loop of the column-oriented algorithm can be parallelized. d. Determine whether the inner loop of the column-oriented algorithm can be parallelized. e. Write one OpenMP program for each of the loops that you determined could be parallelized. You may find the single directive useful- when a block of code is being executed in parallel and a sub-block should be executed by only one thread, the sub-block can be modified by a pragma omp single directive. The threads in the executing team will block at the end of the directive until all of the threads have completed it. f. Modify your parallel loop with a schedule(runtime) clause and test the program with various schedules. If your upper triangular system has 10,000 variables, which schedule gives the best performance? 5.5. Use OpenMP to implement a program that does Gaussian elimination. (See the preceding problem.) You can assume that the input system doesn't need any row-swapping

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!