辅导data留学生、R编程语言调试、讲解R设计
- 首页 >> 其他 The matrices A, B and C are of dimensions n-by-n with entries independently drawn from N(0,1)N(0,1), the standard normal distribution of mean 0 and variance 1.
(1a) Write a program in R to compute the inverses of matrices A, B and C (generated by you) for n=50k,k=1,2,...,10n=50k,k=1,2,...,10, with i) the default serial computing, and ii) parallel computing using three processors.
(1b) Track the computation times for each n for both computing methods (20 time records total). Plot the times against n. Compare and comment.
(1c) Assuming your program did exactly what’s asked in (1a), no more, no less.
Your plot in (1b) will have some unreasonable pattern that make it not a “fair” comparison between parallel and serial computing. Comment and correct the unreasonable part, make a plot described in (1b) again.
Notes:
Please include (not in a separate file) your appropriately commented code, with a step checking the number of cores your computer has.
If your computer is very fast, you make need to add large values of k, until the advantage of parallel computing is illustrated.
(1a) Write a program in R to compute the inverses of matrices A, B and C (generated by you) for n=50k,k=1,2,...,10n=50k,k=1,2,...,10, with i) the default serial computing, and ii) parallel computing using three processors.
(1b) Track the computation times for each n for both computing methods (20 time records total). Plot the times against n. Compare and comment.
(1c) Assuming your program did exactly what’s asked in (1a), no more, no less.
Your plot in (1b) will have some unreasonable pattern that make it not a “fair” comparison between parallel and serial computing. Comment and correct the unreasonable part, make a plot described in (1b) again.
Notes:
Please include (not in a separate file) your appropriately commented code, with a step checking the number of cores your computer has.
If your computer is very fast, you make need to add large values of k, until the advantage of parallel computing is illustrated.