Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wound-wait #16

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions plor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
cmake_minimum_required(VERSION 3.10)

project(ccbench_ss2pl
VERSION 0.0.1
DESCRIPTION "ss2pl of ccbench"
LANGUAGES CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")

option(ENABLE_SANITIZER "enable sanitizer on debug build" ON)
option(ENABLE_UB_SANITIZER "enable undefined behavior sanitizer on debug build" OFF)
option(ENABLE_COVERAGE "enable coverage on debug build" OFF)

find_package(Doxygen)
find_package(Threads REQUIRED)
find_package(gflags REQUIRED)
find_package(glog REQUIRED)
find_package(Boost
COMPONENTS filesystem)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(CompileOptions)

file(GLOB ERMIA_SOURCES
"../common/result.cc"
"../common/util.cc"
"ss2pl.cc"
"result.cc"
"transaction.cc"
"util.cc"
)

add_executable(ss2pl.exe ${ERMIA_SOURCES})

target_link_libraries(ss2pl.exe
Boost::filesystem
gflags::gflags
${PROJECT_SOURCE_DIR}/../third_party/mimalloc/out/release/libmimalloc.a
${PROJECT_SOURCE_DIR}/../third_party/masstree/libkohler_masstree_json.a
Threads::Threads
)

if (DEFINED ADD_ANALYSIS)
add_definitions(-DADD_ANALYSIS=${ADD_ANALYSIS})
else ()
add_definitions(-DADD_ANALYSIS=0)
endif ()

if (DEFINED BACK_OFF)
add_definitions(-DBACK_OFF=${BACK_OFF})
else ()
add_definitions(-DBACK_OFF=0)
endif ()

add_definitions(-DDLR1)

if (DEFINED KEY_SIZE)
add_definitions(-DKEY_SIZE=${KEY_SIZE})
else ()
add_definitions(-DKEY_SIZE=8)
endif ()

if (DEFINED KEY_SORT)
add_definitions(-DKEY_SORT=${KEY_SORT})
else ()
add_definitions(-DKEY_SORT=0)
endif ()

if (DEFINED MASSTREE_USE)
add_definitions(-DMASSTREE_USE=${MASSTREE_USE})
else ()
add_definitions(-DMASSTREE_USE=1)
endif ()

if (DEFINED VAL_SIZE)
add_definitions(-DVAL_SIZE=${VAL_SIZE})
else ()
add_definitions(-DVAL_SIZE=4)
endif ()
50 changes: 50 additions & 0 deletions plor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 2PL

## How to use
- Build masstree in ccbench directory
```
$ ./build_tools/bootstrap.sh
```
This makes ccbench/third_party/masstree/libkohler_masstree_json.a used by building ss2pl.
- Build mimalloc in ccbench directory
```
$ ./build_tools/bootstrap_mimalloc.sh
```
This makes ../third_party/mimalloc/out/release/libmimalloc.a used by building ss2pl.
- Build
```
$ mkdir build
$ cd build
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
$ ninja
```
- Confirm usage
```
$ ./ss2pl.exe -help
```
- Execution example
```
$ numactl --interleave=all ./ss2pl.exe -clocks_per_us=2100 -extime=3 -max_ope=10 -rmw=0 -rratio=100 -thread_num=224 -tuple_num=1000000 -ycsb=1 -zipf_skew=0
```

## How to customize options in CMakeLists.txt
- `ADD_ANALYSIS` : If this is 1, it is deeper analysis than setting 0.<br>
default : `0`
- `BACK_OFF` : If this is 1, it use Cicada's backoff.<br>
default : `0`
- `KEY_SORT` : If this is 1, its transaction accesses records in ascending key order.<br>
default : `0`
- `MASSTREE_USE` : If this is 1, it use masstree as data structure. If not, it use simple array αs data structure.
default : `1`
- `VAL_SIZE` : Value of key-value size. In other words, payload size.<br>
default : `4`
- `DLR0` : Dead lock resolution is timeout.
- `DLR1` : Dead lock resolution is no-wait.

## Optimizations
- Backoff.
- Timeout of dead lock resolution.
- No-wait of dead lock resolution.

## Implementation
- Lock : reader/writer lock
Binary file added plor/build/.ninja_deps
Binary file not shown.
8 changes: 8 additions & 0 deletions plor/build/.ninja_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ninja log v5
0 480 1674198434910686697 CMakeFiles/ss2pl.exe.dir/home/tngngn/ccbench/common/result.cc.o 9fbf35805e4ff104
0 795 1674198435222682920 CMakeFiles/ss2pl.exe.dir/home/tngngn/ccbench/common/util.cc.o ea91cc4076eebbc0
1 954 1674198435382680983 CMakeFiles/ss2pl.exe.dir/result.cc.o 85396cc23d600c0
2 1368 1674198435794675994 CMakeFiles/ss2pl.exe.dir/util.cc.o 49806984b2de2094
1 1590 1674198436018673282 CMakeFiles/ss2pl.exe.dir/ss2pl.cc.o 368bb879e9c807e0
2 1692 1674198436118672071 CMakeFiles/ss2pl.exe.dir/transaction.cc.o 42829a35c2d509ed
1693 1802 1674198436230670715 ss2pl.exe 778c60f2ac8f7589
Loading