Skip to content

Commit ec7e2f5

Browse files
committed
clean up
1 parent 5bceec3 commit ec7e2f5

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
## libCacheSim - a library for cache simulation, profiling, and analysis
22

33

4-
<!-- ![Build Status](https://travis-ci.com/1a1a11a/libCacheSim.svg?token=yJEqB6qLmWucGFp9zK4U&branch=master) -->
5-
<!-- ![Build Status](https://github.com/1a1a11a/libCacheSimPrv/actions/workflows/ci.yml/badge.svg?branch=develop) -->
6-
[![cmake](https://github.com/1a1a11a/libCacheSimPrv/actions/workflows/cmake.yml/badge.svg)](https://github.com/1a1a11a/libCacheSimPrv/actions/workflows/cmake.yml)
7-
4+
[![build](https://github.com/1a1a11a/libCacheSimPrv/actions/workflows/cmake.yml/badge.svg)](https://github.com/1a1a11a/libCacheSimPrv/actions/workflows/cmake.yml)
85
[![Documentation Status](https://readthedocs.org/projects/libCacheSim/badge/?version=master)](http://libCacheSim.readthedocs.io/en/develop/?badge=master)
96
[![GitHub version](https://badge.fury.io/gh/1a1a11a%2FlibCasheSim.svg)](https://badge.fury.io/gh/1a1a11a%2FlibCasheSim)
107
![visitors](https://visitor-badge.glitch.me/badge?page_id=1a1a11a.libCacheSim)

cmake/Version.cmake

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# from xgboost
3+
function (write_version)
4+
message(STATUS "xgboost VERSION: ${xgboost_VERSION}")
5+
configure_file(
6+
${xgboost_SOURCE_DIR}/include/config.h.in
7+
${xgboost_SOURCE_DIR}/include/config.h @ONLY)
8+
# configure_file(
9+
# ${xgboost_SOURCE_DIR}/cmake/Python_version.in
10+
# ${xgboost_SOURCE_DIR}/python-package/xgboost/VERSION @ONLY)
11+
endfunction (write_version)

libCacheSim/bin/cachesim/main.c

+11-3
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,21 @@ int main(int argc, char **argv) {
8888
args.cache_sizes,
8989
NULL, 0, args.n_thread);
9090

91+
char output_str[1024];
92+
char output_filename[128];
93+
sprintf(output_filename, "result/%s", rindex(args.trace_path, '/') + 1);
94+
FILE *output_file = fopen(output_filename, "a");
9195
for (int i = 0; i < args.n_cache_size; i++) {
92-
printf("%s %s, cache size %16" PRIu64 ": miss/n_req %16" PRIu64 "/%16" PRIu64 " (%.4lf), "
96+
snprintf(output_str, 1024,
97+
"%s %s, cache size %16" PRIu64 ": miss/n_req %16" PRIu64 "/%16" PRIu64 " (%.4lf), "
9398
"byte miss ratio %.4lf\n",
94-
args.trace_path, args.alg, result[i].cache_size, result[i].n_miss, result[i].n_req,
99+
output_filename, args.alg, result[i].cache_size, result[i].n_miss, result[i].n_req,
95100
(double) result[i].n_miss / (double) result[i].n_req,
96-
(double) result[i].n_miss_byte / (double) result[i].n_req_byte);
101+
(double) result[i].n_miss_byte / (double) result[i].n_req_byte);
102+
printf("%s", output_str);
103+
fprintf(output_file, "%s", output_str);
97104
}
105+
fclose(output_file);
98106
}
99107

100108
close_reader(args.reader);

libCacheSim/bin/cachesim/priv/params.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static inline void set_param_with_workload(sim_arg_t *args) {
199199
}
200200
args->n_cache_size = sizeof(s) / sizeof(uint64_t);
201201
} else if (strstr(args->trace_path, "cluster") != NULL) {
202-
uint64_t s[12] = {8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384};
202+
uint64_t s[9] = {64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384};
203203
for (int i = 0; i < sizeof(s) / sizeof(uint64_t); i++) {
204204
args->cache_sizes[i] = MiB * s[i];
205205
}

0 commit comments

Comments
 (0)