-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREAD.me
66 lines (56 loc) · 3.19 KB
/
READ.me
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
I/O Performance: File sort
This project is implemented to fulfill my SW Eng course's Individual Project.
The goal of the project is to map and model the effects on the CPU and I/O perfo
rmance of a program under various situations. The system provides two C++ progra
ms: one to create the input files and the other that will be modelled. The input
files contain a variable number of lines, variable number of integer values per
line, and modifiable min/max integer values to be pseudo-randomly generated. Th-
ese files will be read by the other and each line sorted; using stable-sort. Th-
ese lines are then written into a new file with -sorted appended to the original
file's name.
Building system:
Included with the system is a Makefile
- make: compiles create_new_files.cpp and sort_integer_files.cpp to create
executables for user to use: create_files and sort_file
- make run: compiles aforementioned .cpp files into executables and runs
them using the default command-line arguments.
- make clean: clears the working directory of generated files
Creating new input files:
Input files can be created by calling the create_files executable generated
using the Makefile with/without command line arguments.
Usage:
./create_files file_name nbr_files nbr_lines nbr_values min_value max_value
Command-Line Arguments, if present, are position locked and all arguments prior
to any desired to be omitted must be stated:
1st) file_name - desired base name for any files created
[may be omitted without affecting position-lock system]
{default='file'}
2nd) nbr_files - desired number of files to be created
{default=3}
3rd) nbr_lines - desired number of lines for the initial file created
[each consecutive file receives an monotonically increasing
multiple of the initial argument
i.e: the second file will have 2*nbr_lines created
third file will have 3*nbr_lines created]
{default=100}
4th) nbr_values - desired number of values per line for the initial file created
[each consecutive file receives an monotonically increasing
multiple of the initial argument
i.e: the second file will have 2*nbr_values per line created
third file will have 3*nbr_values per line created]
{default=100}
5th) min_value - desired minimum integer value to be generated
{default=1}
6th) max_value - desired maximum integer value to be generated
{default=100}
Sorting Files:
Sorting files creates a new file with the integers on each line sorted from
from least to greatest. This file is stored under the original file's name
with a _'-sorted'_ tag added before the format suffix
Usage:
./sort_file file_name
Command-Line Arguments, if present, are position locked and all arguments prior
to any desired to be omitted must be stated:
1st) file_name - desired base name for any files created
[may be omitted without affecting position-lock system]
{default='file0'}