Skip to content

Commit

Permalink
several minor fixes
Browse files Browse the repository at this point in the history
fix install_dependency that repeated invoke will error and exit;
fix S3-FIFO print parameters
  • Loading branch information
Juncheng Yang committed Nov 5, 2024
1 parent 8158069 commit 69ffd3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
10 changes: 5 additions & 5 deletions libCacheSim/cache/eviction/S3FIFO.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// This version (S3FIFO.c) differs from the original S3-FIFO (S3FIFOv0.c) in that when the small queue is full, but the cache is not full,
// the original S3-FIFO will insert into the small queue, but this version will insert into the main queue.
// This version is in general better than the original S3-FIFO because
// This version (S3FIFO.c) differs from the original S3-FIFO (S3FIFOv0.c) in that when the small queue is full, but the
// cache is not full, the original S3-FIFO will insert into the small queue, but this version will insert into the main
// queue. This version is in general better than the original S3-FIFO because
// 1. the objects inserted after the cache is full are evicted more quickly
// 2. the objects inserted between the small queue is full and the cache is full are kept slightly longer
//
Expand Down Expand Up @@ -483,8 +483,8 @@ static inline bool S3FIFO_can_insert(cache_t *cache, const request_t *req) {
// ***********************************************************************
static const char *S3FIFO_current_params(S3FIFO_params_t *params) {
static __thread char params_str[128];
snprintf(params_str, 128, "fifo-size-ratio=%.4lf,main-cache=%s\n", params->fifo_size_ratio,
params->main_cache->cache_name);
snprintf(params_str, 128, "fifo-size-ratio=%.4lf,ghost-size-ratio=%.4lf,move-to-main-threshold=%d\n",
params->fifo_size_ratio, params->ghost_size_ratio, params->move_to_main_threshold);
return params_str;
}

Expand Down
18 changes: 12 additions & 6 deletions scripts/install_dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ setup_macOS() {

setup_xgboost() {
pushd /tmp/
git clone --recursive https://github.com/dmlc/xgboost
if [ ! -d "xgboost" ]; then
git clone --recursive https://github.com/dmlc/xgboost
fi
pushd xgboost
mkdir build
mkdir build || true
pushd build
cmake ..
if [[ ${GITHUB_ACTIONS:-} == "true" ]]; then
Expand All @@ -35,7 +37,9 @@ setup_xgboost() {

setup_lightgbm() {
pushd /tmp/
git clone --recursive https://github.com/microsoft/LightGBM
if [ ! -d "LightGBM" ]; then
git clone --recursive https://github.com/microsoft/LightGBM
fi
pushd LightGBM
mkdir build || true
pushd build
Expand All @@ -49,9 +53,11 @@ setup_lightgbm() {
}

setup_zstd() {
pushd /tmp/
wget https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz
tar xvf zstd-1.5.0.tar.gz;
pushd /tmp/;
if [ ! -f "zstd-1.5.0.tar.gz" ]; then
wget https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz
tar xvf zstd-1.5.0.tar.gz;
fi
pushd zstd-1.5.0/build/cmake/
mkdir _build || true
pushd _build/;
Expand Down

0 comments on commit 69ffd3b

Please sign in to comment.