Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write c code for the current version of gcc 5.4. Recall that when we solve a large linear system, we often use Gaussian elimination

image text in transcribedimage text in transcribed

please write c code for 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: 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 ragma 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago