Here is the revised README for the ioOptimization project:
The ioOptimization project focuses on optimizing disk I/O operations using various C++ programs. The project is divided into multiple parts, each targeting different aspects of I/O optimization such as measurement, caching, system calls, and raw performance.
- Extract the
codes.zipfile and run the compilation script to compile all provided C++ files. - There are three script files:
- Compilation script: Compiles all programs.
- Execution script: Executes all compiled code.
- Extra credit script: Compiles and executes additional code (e.g., dd compare code and Google benchmark).
- For the execution and extra credit scripts, you may need to change filenames accordingly.
- If you encounter "Permission denied" issues, run
chmod -x <scriptname>. - For optimal file size execution within a reasonable time, run 'run2' separately and change the filename accordingly in
executionScript.sh. - Default filename in
executionScript.shandextracreditScript.shis "ubuntu-21.04-desktop-amd64.iso". You can change the filename or run the code manually.
- Code compilation command:
g++ -std=c++11 -O3 run.cpp -o run
Write a program that can read and write a file from disk using the C/C++ library's open, read, write, and close functions.
- Parameters:
- File name
- File size (for writing)
- Block size (how much to read with a single call)
- Execute:
./run <filename> [-r|-w] <block_size> <block_count>
Write a program to find a file size that can be read in a reasonable time (between 5 and 15 seconds).
- Input: block size
- Output: file size/block count
- Execute:
./run2 <filename> <block_size>
Make your program output the performance achieved in MiB/s and create a graph showing performance as block size changes.
Experiment with clearing the caches and not. Create a graph showing performance for cached and non-cached reads for various block sizes.
- Clear cache:
sudo sh -c "/usr/bin/echo 3 > /proc/sys/vm/drop_caches" - Execute:
./run3 <file_name> block_size./run3 <file_name> block_size(again for cached performance)
Measure performance in MiB/s and B/s when using a block size of 1 byte.
- Execute:
./run5a <file_name> 1and./run5b <file_name> 1
Optimize your program to run as fast as possible. Report both cached and non-cached performance numbers.
- Execute:
./fast <filename>
This project provides a comprehensive framework for optimizing disk I/O operations. Each part focuses on different optimization techniques, making it a versatile tool for performance analysis and improvement.