Steve,
The 85 million random order sort has now been running for 7.5 hours. The delay is the bubble sort performance; which I have now stopped.
The following link is to the latest test program to demonstrate possible performance of sorting a large set of numbers.
The program :
allocates a large real8 array and an integer4 index array ( as all sorts tested are indexed sorts)
4 possible sorts are provided to test their suitability for random or partially random lists of numbers:
dsort is a quick sort, which is probably the most suitable sort
iheap_sort
shell sort,
bubble sort
(dsort@ fails as the list is too big; the split list is probably too small)
Options are provided via variables in the program:
list_size = size of array to sort
near_ordered = false for a random set of numbers, or true if the numbers are conditioned.
random_band = the nominal bandwidth of the bubble sort, which controls a combination of ordered and random values, ie to represent how much the time variables would be out of order.
To select a different option, the variables in the program must be changed and the program rebuilt.
ftn95_test.bat builds and runs the program, appending the results to time_test.log
You can download the .zip file from my dropbox:
https://www.dropbox.com/s/ch85efojh9ysax7/time_test_4.zip?dl=0
The results show:
dsort (quick sort) is by far the best it takes about 50 seconds for a random list of 85 mil values and about 5 seconds for a fairly ordered set.
Then comes heap and shell, but unless the numbers are extremely ordered, they are not worth considering.
Bubble sort is the worst for random order; it takes hours, but if the numbers are extremely ordered, say out of place by a few positions, then it can be the best.
Anyway, this program demonstrates:
Allocation of arrays
populating the arrays (random values and initialise the index)
sorting the array
testing the sort
(timing the test)
It can run as 32-bit or /64 and doesn't use the stack
(Oddly enough) I would recommend to read the 85 mil values into memory and do a quick sort. It would take about 50 seconds, which is probably not very slow, given the time it takes to read the values from file and convert the text to real*8 values (see recent posts on file reading speeds ?)
This should be much simpler than splitting out an un-ordered list, sorting this list and then re-merging.
Hopefully it provides some ideas.
John