- Make sure you have 120GB of free memory on your computer if you want to sort 10 billion floats. The slurm cluster should have sufficient memory.
- Run 'make' to make all the files.
- (If you do not have an input file) Generate input files by using the command:
./generateFloats --nSize 10000000000
- Clean up any previous files generated by the sort program by running this command:
rm sorted*
- Run the sort program by using one of the commands below:
To run the serial version:
./sort_serial --nSize 10000000000 --nSplit 10 Expected runtime: ~3 hours
To run the parallel version:
./sort_parallel --nSize 10000000000 --nSplit 2 --nThreads 8 Expected runtime: ~50 mins
There is no MPI version.
--nSize = how many numbers are in input file that you generated (10 billiion for the assignment) --nSplit = the number of files we split the input file into (we suggest using the recommended values above for better performance)
--nSize = how many numbers are in input file that you generated (10 billiion for the assignment) --nSplit = the number of files that each thread will split their portion of the file into (we suggest using the recommended values above for better performance) --nThreads = the number of threads
Since the program takes a long time to run, we added print statements to indicate which part of the program is currently running.
Example output ./sort_serial --nSize 1000000000 --nSplit 10 Number of floating points : 1000000000 Number of split points : 10 Finished reading from large file, index: 0 Finished writing array 0 to bin file sortedFloats_0.bin Finished reading from large file, index: 1 Finished writing array 1 to bin file sortedFloats_1.bin Finished reading from large file, index: 2 Finished writing array 2 to bin file sortedFloats_2.bin Finished reading from large file, index: 3 Finished writing array 3 to bin file sortedFloats_3.bin Finished reading from large file, index: 4 Finished writing array 4 to bin file sortedFloats_4.bin Finished reading from large file, index: 5 Finished writing array 5 to bin file sortedFloats_5.bin Finished reading from large file, index: 6 Finished writing array 6 to bin file sortedFloats_6.bin Finished reading from large file, index: 7 Finished writing array 7 to bin file sortedFloats_7.bin Finished reading from large file, index: 8 Finished writing array 8 to bin file sortedFloats_8.bin Finished reading from large file, index: 9 Finished writing array 9 to bin file sortedFloats_9.bin Finished sorting 10 files Merging all sorted files into one
Finished merging all sorted files into one Time taken to sort: 498.032410
Validating the output. Checking if the array is sorted in ascending order. Validation complete. Array was sorted correctly