

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
In this document, students are provided with instructions for assignment 2 in csi 702, fall 2008. The assignment requires modifying an existing code to use pthreads to reduce computational time. Students must compile and run the code on linux workstations, add thread-related modifications, and compare the results with the original unthreaded code. The final project should be packaged as a tar file and submitted online.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


CSI 702- Fall 2008 - Assignment 2 Due: October 1, 2008
In this assignment, you will modify an existing code to use pthreads to reduce the computa- tional time. The final assignment will be submitted by the beginning of class on Monday October
gcc -o mandel -lpthread mandel.c
(a) Modify the mandel subroutine so that the input value will set the limits of the outer loop. You will need to modify the variables istart and iend to change so that it represents a unique and equal share of the work based on the thread id and the total number of threads in the system. (b) Add an appropriate offset so that the correct region of the img array is updated. (c) Change the mandel routine to record the the time spent in executing each thread. (d) Add the pthread calls to create and join threads for these routines. (e) Add appropriate output routines to print the time spent in each thread along with the total execution time in the code.
At the end of the project, you will create a “tar” file that contains the code, instructions, plots, and analysis. The code should be put into your public html directory on access.cos.gmu.edu and named ”c702f08-hw1.tar”. If you have placed it in the directory correctly, I will be able to access the file using a web browser using the URL
http://www.cos.gmu.edu/~accountname/c702f08-hw1.tar
The tar file “c702f08-hw1.tar” will contain.