Skip to content

Commit 9ba8009

Browse files
authored
Fix: documentation about 'auto' keyword in cachesim (#278)
* Fix: cache sizes generated with 'auto' keyword in docs * Add comment about 'auto' keyword being used
1 parent 9646c8e commit 9ba8009

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

doc/quickstart_cachesim.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

2-
# cachesim user guide
3-
cachesim is a tool provided by libCacheSim to quickly run some cache simulations, it supports
4-
* a variety of eviction algorithms such as FIFO, LRU, LFU, ARC, SLRU, LeCaR, CACHEUS, Hyperbolic, LHD, TinyLFU, Belady, LRB and GLCache.
5-
* a variety of admission algorithms such as size, bloomFilter and adaptSize.
6-
* text, csv trace as well as binary traces.
7-
* automatic multi-threaded simulations.
2+
# cachesim user guide
3+
cachesim is a tool provided by libCacheSim to quickly run some cache simulations, it supports
4+
* a variety of eviction algorithms such as FIFO, LRU, LFU, ARC, SLRU, LeCaR, CACHEUS, Hyperbolic, LHD, TinyLFU, Belady, LRB and GLCache.
5+
* a variety of admission algorithms such as size, bloomFilter and adaptSize.
6+
* text, csv trace as well as binary traces.
7+
* automatic multi-threaded simulations.
88

9-
Meanwhile, cachesim has high-performance with low resource usages.
9+
Meanwhile, cachesim has high-performance with low resource usages.
1010

1111
---
1212

1313
## Installation
14-
First, [build libCacheSim](/doc/install.md). After building libCacheSim, `cachesim` should be in the build directory.
14+
First, [build libCacheSim](/doc/install.md). After building libCacheSim, `cachesim` should be in the build directory.
1515

1616
---
1717

@@ -24,12 +24,12 @@ use `./cachesim --help` to get more information.
2424

2525
### Run a single cache simulation
2626

27-
Run the example vscsi trace with LRU eviction algorithm and 1GB cache size.
28-
Note that vscsi is a trace format, we also support csv traces.
27+
Run the example vscsi trace with LRU eviction algorithm and 1GB cache size.
28+
Note that vscsi is a trace format, we also support csv traces.
2929

3030
```bash
3131
# Note that no space between the cache size and the unit, unit is not case sensitive
32-
./cachesim ../data/trace.vscsi vscsi lru 1gb
32+
./cachesim ../data/trace.vscsi vscsi lru 1gb
3333
```
3434

3535
### Run multiple cache simulations
@@ -55,7 +55,7 @@ Note that vscsi is a trace format, we also support csv traces.
5555

5656

5757
### Auto detect cache sizes
58-
cachesim can detect the working set of the trace and automatically generate cache sizes at 0.0001, 0.0003, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3 of the working set size.
58+
cachesim can detect the working set of the trace and automatically generate cache sizes at 0.001, 0.003, 0.01, 0.03, 0.1, 0.2, 0.4, 0.8 of the working set size.
5959
You can enable this feature by setting cache size to 0 or auto.
6060

6161
```bash
@@ -81,7 +81,7 @@ cachesim supports the following algorithms:
8181
* [BeladySize](/libCacheSim/cache/eviction/BeladySize.c)
8282
* [QD-LP](/libCacheSim/cache/eviction/QDLP.c)
8383

84-
You can just use the algorithm name as the eviction algorithm parameter, for example
84+
You can just use the algorithm name as the eviction algorithm parameter, for example
8585

8686
```bash
8787
./cachesim ../data/trace.vscsi vscsi lecar auto
@@ -94,12 +94,12 @@ You can just use the algorithm name as the eviction algorithm parameter, for exa
9494
```
9595

9696

97-
### Use different trace types
97+
### Use different trace types
9898
We have demonstrated the use of cachesim with vscsi trace. We also support csv traces.
99-
To use a csv trace, we need to provide the column of *time*, *obj-id*, and *obj-size*.
99+
To use a csv trace, we need to provide the column of *time*, *obj-id*, and *obj-size*.
100100
Both time and size are optional, but many algorithms rely on time and size to work properly.
101101
The column starts from 1, the first column is 1, the second is 2, etc.
102-
Besides the column information, a csv reader also requires the delimiter and whether the csv file has a header.
102+
Besides the column information, a csv reader also requires the delimiter and whether the csv file has a header.
103103
cachesim builds in a simple delimiter and header detector, if the detected result is not correct, you can provide the correct information using `delimiter=,`, `has-header=true`.
104104

105105

@@ -115,7 +115,7 @@ cachesim builds in a simple delimiter and header detector, if the detected resul
115115
./cachesim ../data/trace.csv csv lru 1gb -t "time-col=2, obj-id-col=5, obj-size-col=4, delimiter=,, has-header=true"
116116
```
117117

118-
Besides csv trace, we also support txt trace and binary trace.
118+
Besides csv trace, we also support txt trace and binary trace.
119119
```bash
120120
# txt trace is a simple format that stores obj-id in each line
121121
./cachesim ../data/trace.txt txt lru 1gb
@@ -133,7 +133,7 @@ Besides csv trace, we also support txt trace and binary trace.
133133
## Advanced usage
134134

135135
cachesim supports many advanced features, you can use `./cachesim --help` to get more information.
136-
Here we give some examples.
136+
Here we give some examples.
137137

138138
### Setting parameters for eviction algorithms
139139
Some eviction algorithms have parameters, you can set the parameters by using `-e "k1=v1,k2=v2"` or `--eviction-params "k1=v1,k2=v2"` format.
@@ -148,29 +148,29 @@ Some eviction algorithms have parameters, you can set the parameters by using `-
148148

149149
### Admission algorithm
150150
cachesim supports the following admission algorithms: size, probabilistic, bloomFilter, adaptSize.
151-
You can use `-a` or `--admission` to set the admission algorithm.
151+
You can use `-a` or `--admission` to set the admission algorithm.
152152
```bash
153153
# add a bloom filter to filter out objects on first access
154154
./cachesim ../data/trace.vscsi vscsi lru 1gb -a bloomFilter
155155
```
156156

157157
### Prefetching algorithm
158158
cachesim supports the following prefetching algorithms: OBL, Mithril, PG (and AMP is on the way).
159-
You can use `-p` or `--prefetch` to set the prefetching algorithm.
159+
You can use `-p` or `--prefetch` to set the prefetching algorithm.
160160
```bash
161161
# add a mithril to record object association information and fetch objects that are likely to be accessed in the future
162162
./cachesim ../data/trace.vscsi vscsi lru 1gb -p Mithril
163163
```
164164

165-
### Advanced features
165+
### Advanced features
166166
```bash
167-
# change number of threads
167+
# change number of threads
168168
./cachesim ../data/trace.vscsi vscsi lru 1gb --num-thread=4
169169

170170
# cap the number of requests read from the trace
171171
./cachesim ../data/trace.vscsi vscsi lru 1gb --num-req=1000000
172172

173-
# change output
173+
# change output
174174
./cachesim ../data/trace.vscsi vscsi lru 1gb -o my-output
175175

176176
# ignore object size, each object has size one
@@ -188,8 +188,3 @@ You can use `-p` or `--prefetch` to set the prefetching algorithm.
188188
# Disable the print of the first few requests
189189
./cachesim ../data/trace.vscsi vscsi lru 1gb --print-head-req=false
190190
```
191-
192-
193-
194-
195-

libCacheSim/bin/cachesim/cli_parser.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ static int conv_cache_sizes(char *cache_size_str, struct arguments *args) {
456456
token = strtok(NULL, ",");
457457
}
458458

459+
// detection of cache size set to 0 or auto
459460
if (args->n_cache_size == 1 && args->cache_sizes[0] == 0) {
460461
set_cache_size(args, args->reader);
461462
}

0 commit comments

Comments
 (0)