Sort Demo 1.0
Graphically demonstrating multiple sort methods
Here is a SHORT VIDEO showing a screen capture of the latest version 1.1 of Sort Demo.
You can't see the mouse pointer, but I deliberately hovered over the toolbar buttons so that the tooltip text would
show up and you'd be able to see what I did. So, TEACHERS, USE THIS IN YOUR CLASSROOMS! And the source is ALWAYS OPEN for EXAMINATION!!!
Anyway, it looks like a lot of hype for a simple application, right? Build InstructionsPre-Requisites
If you have autotools and want to re-build the configure script, the basic method is to first run 'aclocal', then 'autoconf', and then 'automake'. This should be enough to do it. Otherwise, just use the script I included. It should work for ya. Configuration (non-windows)
For a Linux or BSD (or similar platform) you'll want to run the 'configure' script in
order to build the Makefile. Example:
Building (non-windows)
Building is simple. Just type 'make' after running './configure', as Running
And to run the application, from the build directory type
There's really no help, but if you pop down the 'Sort' menu you'll see several
sort options, slowest being 1 and fastest being 8. These correspond to the
buttons in the middle of the tool bar. You can use menus or toolbar buttons
as you see fit. The left-most button generates NEW data, and the next one (the 'magician hat') recovers the previous data (so you can compare methods). In the examples at the top of the web page, the fastest method (multi-thread quick sort) was used. If you were to recover the data and use a different method (such as single-thread quick sort) you can get an idea how they compare. On average the multi-thread quick sort is about 2.5 times faster than the single-thread quick sort. The multi-thread quick sort simulates a 4-core machine, but the bulk of the time is spent on the first iteration (which must be done single-threaded). After that, multiple work units are scheduled, and the rest of the sort goes by VERY quickly since you are sorting several sections simultaneously (instead of just one section at a time). A *NEW* feature, the 'speed' button (green with 'go' written on it) can toggle the speed at which the sort happens, EVEN WHILE THE SORT IS RUNNING. There is a corresponding menu item for this as well, under 'Sort'. It has a checkbox, and is (by default) set to FAST. This feature is ONLY in the wxWidgets version, however, so for a windows system you would need to build it using wxWidgets. Your Mileage May Vary. Anyway, have fun, and don't blame me if something goes wrong. This app comes with known bugs and things that may not harm your system, or perhaps they may (use it at YOUR risk, not MINE). It's open source so you can do what you want with it. You may find GPL licensing there, or not (I can't remember right now) and just assume it's public domain unless you see otherwise. About multi-threaded quick sortSome multi-threaded algorithms are Embarassingly Parallel in that they are very very easy to implement. An example of that could be a discrete fourier transform (aka DFT). Each 'harmonic' can be independently calculated from the others, and each one requires about the same amount of time to calculate. So the total time to do the calculation is approximately divided by the total number of processors you can devote to it, with one thread dedicated to each harmonic. You could even schedule them ALL in parallel and get just about the same result (up to a point where resource allocation becomes a problem). On the other hand, parallel processing of a quick sort isn't so easy. In fact, all you can really do is schedule "the bottom half" portion as 2 separate threads, each of which could spawn more threads in its bottom half (as needed). This can create SOME scheduling conflicts and dependency issues which I deal with in 'sortdemo' (edge cases, mostly). So it is a good example of an algorithm which isn't 'parallel', but must be divided up into 'work units' that often depend on one another to complete before the process can move forward. Copyright © 2011-2020 by Big Bad Bob Frazier, all rights reserved. |