Download the 2002 Performance/Price Sort and PennySort Report:

DOC format: 2002 Performance Price Sort and PennySort.doc

PDF format: 2002 Performance Price Sort and PennySort.pdf

PowerPoint Report: 2002 Performance Price Sort and PennySort.ppt

Algorithm Design (in Chinese): THSort Algorithm.doc

 

Download THSort for Linux

RAR format:  THSort.rar

ZIP format: THSort.zip

Raw records generator: SortGen.c  

Compile in Linux:  cc SortGen.c /o SortGen

Usage:  ./SortGen  <record_number> <filename>

 

 

How to use our PennySort program THSort?

 

 

       Our program is tuned on our customized computer configured with Abit KR7A-RAID, 4*256MB DDR 266 Memory, 4*40GB IBM disks, and Redhat 7.2 Linux operating system. The following steps 1-3 tell you how to install Redhat 7.2 on our machine. Since Redhat 7.2 hasn’t integrated the driver for HPT372 RAID controller which is on the motherboard yet, you’ll find it easier to install the system by following these steps. And step 4-6 tell you how to run the program. Wish you good luck!

 

 

Install Redhat 7.2 on the computer

 

Step 1

Attach the four disks to IDE3 and IDE4. While the computer is booting, press Ctrl+H to run RAID setup, and then configure the master disk of IDE3 and master disk of IDE4 as an array, the slave disk of IDE3 and slave disk of IDE4 as another array.

 

Step 2

    Download the driver of RAID controller HPT372 from http://www.highpoint-tech.com/RedHat_v13_370_372.zip. Then decompress it, and extract the two image files, rhdd-athlon.img and rh72boot.img, to two floppy disks separately. (We call the former disk A, and the latter disk B.)

 

Step 3

1) Use disk B to boot the machine, then type “expert text updates”

2) Choose “Yes” when you are asked “Do you have a driver disk?”

3) Insert disk A when the message “Insert your driver disk and press OK to continue” appears.

4) Then you can install RedHat properly.

5) When the message “Installation Complete” appears, press Alt-F2 to switch to another command console, and type:

#chroot /mnt/sysimage

#mkdir /mnt/floppy

#mount /dev/fd0 /mnt/floppy

# sh /mnt/floppy/postinstall

#umount /mnt/floppy

6) Press Alt-F1 to switch the command console back and finish all the installation process.

 

Run THSort

 

Step 4

    On Linux console, edit the only line in the file /proc/sys/kernel/shmmax to be 0x20000000 (This value controls the size of shared memory allowed by the system. Every time you reboot, you need change it like this. And this step can be omitted if you can change the system script file.)

 

Step 5

       Before you run our program, you should know how to configure the parameters of the program. All this can be done by editing the content of the file ‘config’:

1) DEVICE_A and DEVICE_B are the working directory of two different disk arrays. (Note: A “/” must be appended to the end of the directory string)

2) INPUT_FILENAME is the name of input source file (the file should be kept on DEVICE_A), and OUTPUT_FILENAME is the name of output file (the file will be saved on DEVICE_A too).

3) MEMORY_SIZE is the size of share memory used by the program. 500M will be a good size under current condition.

4) DATA_COUNT is the number of total records, DATA_BLOCK_COUNT is the number of records in each block. Note: DATA_COUNT must divide exactly by 3*DATA_CLOCK_COUNT.

5) If you use our program on other machines and find it don not work, we suggest you to increase the value of DELAYTIME a little. But if the number is greater, the speed of the program will be a little slower.

 

Step 6

Run “./mainthread”

Or use “time ./mainthread” to see the time count.

 

 

Support Email:

liup@tirc.cs.tsinghua.edu.cn

shiyao@yeah.net