Assignment - Exercise #4, Due 2003 March 6

Take the problem of the first assignment (trapezoid), and port the code from MPI to pthreads and sockets. In particular have the main thread creating as many new threads as the user requests (with the use of an argument to the program). These new threads should compute a part of the integral and then submit their result to the main thread through an Internet socket (using any protocol you prefer). Finally the main thread should add the partial results and print the value of the integral.
Write (in a comment at the top of your code) 1 to 10 lines with the experiences you had, i.e. on what machine/OS did you run your experiments, what kind of problems did you have (if any), how did pthreads/sockets affect the performance in comparison with the MPI version.


Links

Theoretic material
Modern Operating Systems, second edition. Andrew Tanenbaum pp. 81-123, 725-726
Operating Systems Principles, Bic & Shaw pp. 112-139

Using Sockets
Beej's Guide to Network Programming
What Is a Socket?, by SUN.

Using Threads
Introduction to POSIX Threads Programming
Getting Started With POSIX Threads
Pthreads for Dynamic and Irregular Parallelism


Final frontier
man page of each systemcall used in the examples
From: "Antonios G. Danalis"