4 Various sorting algorithms.
9 =========== ===============================================
11 Makefile Automate building and cleanup.
12 data.py Generate random data for the 'data' file.
13 scaling.py Script to generate time-scaling data.
14 main.c Command line framework for a sorting algorithm.
15 sort.h Header declaring sort function syntax.
16 bubble.c Bubble sort implementation of sort.h.
17 quicksort.c Quicksort implementation of sort.h.
18 =========== ===============================================
27 which also builds a random data file 'data'. To build with the DEBUG
28 macro defined (to enable some stderr printouts in main.c), run
32 To get timing information, compile with
34 $ make CFLAGS=-DDEBUG_TIMING
36 Although the chunk-merge portion of the sort is generally much quicker
37 than the chunk sorting itself, it is less clear what the fastest
38 chunk-merge algorithm is. Set the MERGE_TYPE macro to test other
39 algorithms, for example:
41 $ make clean && make "CFLAGS=-DDEBUG_TIMING"
42 $ ./data.py 100000 | mpiexec -n 3 ./parallel-quicksort >/dev/null
43 sorted 100000 elements in 20.9942 seconds and merged in 0.0027411 seconds
44 $ make clean && make "CFLAGS=-DDEBUG_TIMING -DMERGE_TYPE=1"
45 $ ./data.py 100000 | mpiexec -n 3 ./parallel-quicksort >/dev/null
46 sorted 100000 elements in 21.3503 seconds and merged in 1.07004 seconds
48 Remove auto-generated files with
55 Start the Message Passing Daemons with
57 $ mpdboot -n 4 -f mpd.hosts
59 which spawns a daemon (`mpd`) on the first four hosts in `mpd.hosts`.
60 Then run your program (e.g. `simplest_message`) with.
62 $ mpiexec -n 4 ./simplest_message
64 When you're done, clean up the daemons with
68 Examples for each of the executables in this package:
70 $ mpiexec -n 4 ./parallel-quicksort data
71 $ mpiexec -n 4 ./parallel-bubble data
76 Time 8191 data points on 4 xphy nodes with
78 $ mpdboot -n 4 -f <(seq 1 4 | sed 's/^/xphy/')
79 $ time mpiexec -n 4 ./parallel-bubble data > /dev/null
80 $ time mpiexec -n 4 ./parallel-quicksort data > /dev/null
83 quicksort takes 0.210 s and bubble takes 0.302 s.
85 TODO: `make scaling` doesn't work yet.
86 You can generate scaling graphs for all executables built by the
91 which generates `*-scaling.dat` and `*-scaling.png` for each