Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can anybody help? The aim of this warm-up project is to give you experience using threads, processes, and make. You are asked to evaluate the

image text in transcribed

can anybody help?

The aim of this warm-up project is to give you experience using threads, processes, and make. You are asked to evaluate the creation/deletion cost for threads and processes. You also need to measure/compare the performance of a thread-based parallel matrix multiplication program on a multicore workstation You are asked to write four C files: et.cep.c para mc timing.c. The file tining.c contains two utility functions start.timer() and stop timer() (Note: no parameters in these two functions). Users can invoke start_timer to start the timer and then call stop timer to stop the clock. The function stop.tiner() should return a float which shows the elapsed time (unit: second) between these two calls. This can be implemented by using gettimeofday(). You may use global variables in timing.c, but you have to provide some kind of information hiding. The files et. and timing care compiled and linked together to build the executable file et crt. In et.c, you need to call pthread.create(/pthread.join() to evaluate the time for thread creation/deletion Similarly, the files ep.c and timing.c are compiled and linked together to generate the executable file ep ert In ep.c, you can invoke fork/waitpid to measure the process creation/deletion time. To see how the dynamic memory affects the performance of thread/process creation, your programs need call the function calloc() to allocate/clean memory before starting the timer The argument argv[1] determines the size of the dynamic memory (in K-Bytes) to be allocated. For example. bach /ep_crt 1024 requests 1024K bytes from the heap area. Note that your child process for thread) needs to update the dynamic memory to see how copy-on-write affects the performance. For comparison purpose, run both of your programs (ep.crt and et crt) with at least five different sizes (e.g. 0, 1024, 4096, 16384, 65536). The files para mm.c and timing.c are compiled and linked together to build the executable para mim In param.c, you need to measure the computation time for multiplying two 160x160 matrices. Your program can split the task to a few threads and each thread just handles a portion of the matrix. The number of computational threads is given through the argument argv[1]. For example. bach% -/para nm 4 uses 4 threads to perform the matrix multiplication. You need to run your program using the following different number of threads: 1, 2, 4,8. 16. Note that your program needs to use pthread barrier wait to let the main thread know that all of the computational threads have done the computation and hence it can stop the timer. Write a makefile to describe the dependency among these files and to build the three executable files et crt. ep_crt, and para mim. Turnin Each student has to submit this project electronically using the following turnin command (on graib turnin -c cis6205 -p proji et.cep.c para.mm.c timing.c makefile Each student also needs to hand in a hard-copy document which includes the description of your code experiences in testing/debugging.. and explanation of the experimental results. The cover page (single sided) should contain your picture, name, and the login id you turnined. Start on time and good luck. If you have any questions, send e-mail to sangeecs.cauchio.edu. The aim of this warm-up project is to give you experience using threads, processes, and make. You are asked to evaluate the creation/deletion cost for threads and processes. You also need to measure/compare the performance of a thread-based parallel matrix multiplication program on a multicore workstation You are asked to write four C files: et.cep.c para mc timing.c. The file tining.c contains two utility functions start.timer() and stop timer() (Note: no parameters in these two functions). Users can invoke start_timer to start the timer and then call stop timer to stop the clock. The function stop.tiner() should return a float which shows the elapsed time (unit: second) between these two calls. This can be implemented by using gettimeofday(). You may use global variables in timing.c, but you have to provide some kind of information hiding. The files et. and timing care compiled and linked together to build the executable file et crt. In et.c, you need to call pthread.create(/pthread.join() to evaluate the time for thread creation/deletion Similarly, the files ep.c and timing.c are compiled and linked together to generate the executable file ep ert In ep.c, you can invoke fork/waitpid to measure the process creation/deletion time. To see how the dynamic memory affects the performance of thread/process creation, your programs need call the function calloc() to allocate/clean memory before starting the timer The argument argv[1] determines the size of the dynamic memory (in K-Bytes) to be allocated. For example. bach /ep_crt 1024 requests 1024K bytes from the heap area. Note that your child process for thread) needs to update the dynamic memory to see how copy-on-write affects the performance. For comparison purpose, run both of your programs (ep.crt and et crt) with at least five different sizes (e.g. 0, 1024, 4096, 16384, 65536). The files para mm.c and timing.c are compiled and linked together to build the executable para mim In param.c, you need to measure the computation time for multiplying two 160x160 matrices. Your program can split the task to a few threads and each thread just handles a portion of the matrix. The number of computational threads is given through the argument argv[1]. For example. bach% -/para nm 4 uses 4 threads to perform the matrix multiplication. You need to run your program using the following different number of threads: 1, 2, 4,8. 16. Note that your program needs to use pthread barrier wait to let the main thread know that all of the computational threads have done the computation and hence it can stop the timer. Write a makefile to describe the dependency among these files and to build the three executable files et crt. ep_crt, and para mim. Turnin Each student has to submit this project electronically using the following turnin command (on graib turnin -c cis6205 -p proji et.cep.c para.mm.c timing.c makefile Each student also needs to hand in a hard-copy document which includes the description of your code experiences in testing/debugging.. and explanation of the experimental results. The cover page (single sided) should contain your picture, name, and the login id you turnined. Start on time and good luck. If you have any questions, send e-mail to sangeecs.cauchio.edu

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_2

Step: 3

blur-text-image_3

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

Mastering Big Data Interview 751 Comprehensive Questions And Expert Answers

Authors: Mr Bhanu Pratap Mahato

1st Edition

B0CLNT3NVD, 979-8865047216

More Books

Students also viewed these Databases questions