The Rust project was built using Cargo. The Cargo.toml files can be found at the following paths:
Specific objectives of the assignment are listed below -
- Learn what type of programming can benefit from multi-core multithreaded programs.
- Learn how to divide data for data parallelization to gain performance
- Learn to create multithreaded programs in RUST
- Learn to handle resource sharing in a multithreaded program
- Learn File I/O in RUST
Full description can be found in the following pdf:
- Clone the repository
- cd into the wanted versions
/src/
directory- Version 1 is the single threaded version found in the ./version_1/src directory
- Version 2 is the multithreaded version found in the ./version_2/src directory
- run
cargo run <data directory path>
to run the program with the data directory path as the argument (e.g../data
for the included test data directory)
Through the use of threading, a significant performance increase was achieved going from between 1.5-2ms to ~1ms. This was achieved by splitting the data into 4 chunks and processing each chunk in a separate thread. The threads were then joined and the results were written to the output file. The code for this can be found in the version 2
directory.