Question: Please do this in the C programming language. Let's implement a general matrix multiplication with use of system calls: gettimeofday and getrusage. You will run

Please do this in the C programming language.
Let's implement a general matrix multiplication with use of system calls: gettimeofday and getrusage. You will run the program for N (matrix size) -1000, 2000, and 4000, respectively to fill up the table in milliseconds: The matrix dimension is N rows by N columns. The matrix element (ij) will be of type "double", initially setting to (double)rand(O/RAND_MAX+1; You will create M multithreads to do the multiplication, dividing the job by rows or columns. Your program will take option "-N" and "-M" as inputs, "yourmul-N n-M m", where n will be the matrix size and m will be the number of threads to be created If you run your program multiple times for the same value of N, pick one of them or avg to fill in the table a) (30%) For M-1 (in milliseconds): Elapsed Time USR Time syS Time USR+SYS Time (25%) For M-2 (in milliseconds) Elapsed Time USR Time SYs Time USR+SYS Time 1000 c) (25%) For M-4 (in milliseconds) Elapsed Time USR Time SYS Time USR+SYS Time 1000 (10%) By checking your system information from "/proc/cpuinfo", list # of cores, its clock speed, and load average (use "uptime") (10%) Compare "Elapsed Time" and "USR+SYS Time" from 5.a) and 5c) for N=4000. Discuss your findings. d) e) Let's implement a general matrix multiplication with use of system calls: gettimeofday and getrusage. You will run the program for N (matrix size) -1000, 2000, and 4000, respectively to fill up the table in milliseconds: The matrix dimension is N rows by N columns. The matrix element (ij) will be of type "double", initially setting to (double)rand(O/RAND_MAX+1; You will create M multithreads to do the multiplication, dividing the job by rows or columns. Your program will take option "-N" and "-M" as inputs, "yourmul-N n-M m", where n will be the matrix size and m will be the number of threads to be created If you run your program multiple times for the same value of N, pick one of them or avg to fill in the table a) (30%) For M-1 (in milliseconds): Elapsed Time USR Time syS Time USR+SYS Time (25%) For M-2 (in milliseconds) Elapsed Time USR Time SYs Time USR+SYS Time 1000 c) (25%) For M-4 (in milliseconds) Elapsed Time USR Time SYS Time USR+SYS Time 1000 (10%) By checking your system information from "/proc/cpuinfo", list # of cores, its clock speed, and load average (use "uptime") (10%) Compare "Elapsed Time" and "USR+SYS Time" from 5.a) and 5c) for N=4000. Discuss your findings. d) e)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
