CS 732 -- Project 3
SORTING -- Phase 1
- Sequential Version
- Read in a file name from the the keyboard
- Open the file and read the first number -- this
will tell you how many numbers will be in
the data file.
- Allocate space for your array
- Fill it up (from the file)
- Start the stopwatch
- Sort
- Stop the stopwatch
- Print out the computation time.
- Parallel Version
- Implement the Bucket Sort
- Time the process with the data in place
(assume it starts on the nodes, and ends up
on the nodes)
- For both the Sequential and the Parallel Versions
- Compute the computation time for arrays of various
sizes (stop when they begin to swap and
thrash -- this will be different for each
algorithm)
- Compute speedup and efficiency for various number
of processors.
- Here is a short program to generate data files if you wish
to use it. generator.c
- Note:
- We will add parallel sorting versions to this when
we cover them later in the course.
- Submit all the appropriate material to the isntructor via
email.
Notes Previous semesters had problems with
- Do not do any work on the master before the clock starts.
(not even calculating the max and the min)
- The master is only to open data file,
- Read how mnay numbers there are (N)
- Tell all the slaves how many numbers they will be
getting.
- have a for loop to read in N/num_proc elements and send
to the next slave
- Start the clock.
- Send message to slaves to start
(they can't start until this point)
- Wait for message from all slaves that they are
done.
- Stop the clock
- Output Wall Clock time
(not CPU usage time)
- The slave should:
- Receive how many numbers it will get
- Allocate space
- Receive those numbers
- Wait for message to start
- Do Parallel Bucket sort with slaves
Yes this involves some exchange between slaves
- When finished send message to master
- There is also to be a writeup turned in.
- Code:
- Undocumentede code will not be graded
- Code that is not indented properly will not be
graded
fredh@cs.unr.edu