Discussion Section for October 4, 2012: Threads!


In Discussion Section

In ds5, you will build a program a test if a number is prime. The simplist way to test for a prime number, num, is:

To speed up this process, you should divide the set into t equal-sized sets. In this MiniMP, you should launch t threads that each test the if a canidate number is prime for a certain sub-set of the set established above.

We have provided example code to help you get started and your discussion section leader will help you with the rest! In this MiniMP, you should see:

Compiling and Running

To compile and run your shell, run the following commands from a Terminal on a Linux machine:

$ make
$ ./ptest <prime canidate> <threads>
$ ./ptest 1234567 1
$ ./ptest 1234567 6