Skip to content
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CMSC624 Final Project

The name of this repository is rather vague, but it contains the source code for
the "From DAGs to Riches: Improving Transaction Throughput in a Deterministic System" paper, which
was produced as, you guessed it, the final project for CMSC624.

Link to presentation: (insert link here)
Link to paper: (insert link here)

# Contributors

Pranav Sivaraman
Rakrish Dhakal
Alex Movsesyan
Expand Down
10 changes: 10 additions & 0 deletions a2_final/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
.deps
bin
obj

.vscode
.DS_Store
.cache/clangd/index
compile_commands.json
work_steal
23 changes: 23 additions & 0 deletions a2_final/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.18)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

project(db_concurrency_control VERSION 0.1.0 LANGUAGES C CXX)

set(DB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(DB_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

find_package(Threads REQUIRED)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

enable_testing()

include(systems)
include(compile)

include_directories(${DB_SOURCE_DIR})

add_subdirectory(src)
79 changes: 79 additions & 0 deletions a2_final/cmake/colorize.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
# @file ColorizeMessage.cmake
#
# @project ECRC
# ECRC is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah University of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###

# Set some colors
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()

# Colorize cmake messages during configure
function(message)
list(GET ARGV 0 MessageType)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldRed}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldYellow}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL AUTHOR_WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${Yellow}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL STATUS)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${Green}${ARGV_STR}${ColourReset}")
else()
string (REPLACE ";" " " ARGV_STR "${ARGV}")
string (REPLACE "${Esc}[1 " "${Esc}[1;" ARGV_STR "${ARGV_STR}")
_message("${ARGV_STR}")
endif()
endfunction()

##
## @end file ColorizeMessage.cmake
##
19 changes: 19 additions & 0 deletions a2_final/cmake/compile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
add_compile_options("-Wall")

#####
# Change the default build type from Debug to Release, while still
# supporting overriding the build type.
#
# The CACHE STRING logic here and elsewhere is needed to force CMake
# to pay attention to the value of these variables.
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
else(NOT CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Build type: Debug. Performance will be terrible!")
message(STATUS "Add -DCMAKE_BUILD_TYPE=Release to the CMake command line to get an optimized build.")
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
endif(NOT CMAKE_BUILD_TYPE)
54 changes: 54 additions & 0 deletions a2_final/cmake/systems.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
INCLUDE(colorize) # colorize and highlight message

IF(WIN32)
SET(HOST_SYSTEM "win32")
ELSE(WIN32)
IF(APPLE)
EXEC_PROGRAM (sw_vers ARGS -productVersion OUTPUT_VARIABLE MACOSX_VERSION)
STRING(REGEX MATCH "[0-9]+.[0-9]+" VERSION "${MACOSX_VERSION}")
SET(MACOS_VERSION ${VERSION})
SET(HOST_SYSTEM "macosx")
IF(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
SET(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOS_VERSION} CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
ENDIF()
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreFoundation -framework Security")
ELSE(APPLE)
IF(EXISTS "/etc/issue")
FILE(READ "/etc/issue" LINUX_ISSUE)
IF(LINUX_ISSUE MATCHES "CentOS")
SET(HOST_SYSTEM "centos")
ELSEIF(LINUX_ISSUE MATCHES "Debian")
SET(HOST_SYSTEM "debian")
ELSEIF(LINUX_ISSUE MATCHES "Ubuntu")
SET(HOST_SYSTEM "ubuntu")
ELSEIF(LINUX_ISSUE MATCHES "Red Hat")
SET(HOST_SYSTEM "redhat")
ELSEIF(LINUX_ISSUE MATCHES "Fedora")
SET(HOST_SYSTEM "fedora")
ENDIF()
ENDIF(EXISTS "/etc/issue")

IF(EXISTS "/etc/redhat-release")
FILE(READ "/etc/redhat-release" LINUX_ISSUE)
IF(LINUX_ISSUE MATCHES "CentOS")
SET(HOST_SYSTEM "centos")
ENDIF()
ENDIF(EXISTS "/etc/redhat-release")

IF(NOT HOST_SYSTEM)
SET(HOST_SYSTEM ${CMAKE_SYSTEM_NAME})
ENDIF()
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wno-unused-but-set-variable -Wno-maybe-uninitialized")
ENDIF(APPLE)
ENDIF(WIN32)

# query number of logical cores
CMAKE_HOST_SYSTEM_INFORMATION(RESULT CPU_CORES QUERY NUMBER_OF_LOGICAL_CORES)

MARK_AS_ADVANCED(HOST_SYSTEM CPU_CORES)

MESSAGE(STATUS "CMSC624 Assignment 2: Understanding Locking, OCC and MVCC")
MESSAGE(STATUS "Found host system: ${HOST_SYSTEM}")
MESSAGE(STATUS "Found host system's CPU: ${CPU_CORES} cores")
122 changes: 122 additions & 0 deletions a2_final/cmsc624-a2-sol-latex-template/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
###############################################################################
# Project Configuration

TARGET = $(shell basename $(PWD)).pdf
MAIN = main

#####

TARGET_BASE = $(basename $(TARGET))

################################################################################
# Command Configuration

PDFLATEX = pdflatex
BIBTEX = bibtex
EPS_TO_PDF = epstopdf
OBJ_TO_EPS = tgif -print -eps -color -stdout
GNUPLOT = gnuplot
SPELLCHECK = aspell -t list

################################################################################
# Gathering Information

TEX_MAIN := $(MAIN).tex

TEX_ALL := $(shell search=$(TEX_MAIN); all=; \
while [ -n "$$search" ] ; do \
all="$$all $$search"; \
search=`egrep "^[^%]*\\input" $$search | \
sed -En 's/.*input[^\{]*\{(.+)\}/\1.tex/p'`; \
done; \
echo "$$all")

GFX_ALL := $(shell for t in $(TEX_ALL); do \
cat $$t | \
egrep '^[^%]*\\includegraphics' | \
sed -En 's/.*includegraphics(\[.+\])?\{([^\{]*)\}.*/\2/p'; \
done)

GFX_FILES := $(shell for g in $(GFX_ALL); do \
ls $$g.* | \
egrep "(\.obj|\.eps)$$" | \
sed -E 's/\.[^ ]+/\.pdf/g'; \
done)

GNUPLOT_FILES := $(shell for g in $(GFX_ALL); do \
test -e $$g.p && \
test ! -e $$g.eps -a ! -e $$g.obj && \
echo $$g.pdf; \
done)

BIB_FILES := $(shell cat $(TEX_MAIN) | \
egrep '^[^%]*\\bibliography\{' | \
sed -E -e 's/.*\{([^\{]+)\}.*/\1/g' \
-e 's/([^,\{\}]+)/\1.bib/g' \
-e 's/,/ /g')

################################################################################
# Command Rules

all: $(TARGET)

$(TARGET): $(TEX_ALL) $(GFX_FILES) $(GNUPLOT_FILES) $(BIB_FILES)
$(PDFLATEX) $(TEX_MAIN) </dev/null
-$(BIBTEX) $(MAIN)
$(PDFLATEX) $(TEX_MAIN) </dev/null
$(PDFLATEX) $(TEX_MAIN) </dev/null
mv $(MAIN).pdf $@

debug:
@echo "TEX_MAIN = $(TEX_MAIN)"
@echo "TEX_ALL = $(TEX_ALL)"
@echo "GFX_ALL = $(GFX_ALL)"
@echo "GFX_FILES = $(GFX_FILES)"
@echo "GNUPLOT_FILES = $(GNUPLOT_FILES)"
@echo "BIB_FILES = $(BIB_FILES)"

clean:
rm -f $(TARGET) $(TARGET_BASE)-gray.pdf $(TARGET_BASE)-final.pdf \
*~ *.bbl *.blg *.log *.aux $(MAIN).out $(GFX_FILES) $(GNUPLOT_FILES)

grayscale: $(TARGET_BASE)-gray.pdf

$(TARGET_BASE)-gray.pdf: $(TARGET)
gs -sOutputFile=$@ -sDEVICE=pdfwrite -sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray -dNOPAUSE \
-dBATCH -dAutoRotatePages=/None $(TARGET)

diff: $(TARGET_BASE)-final.pdf

$(TARGET_BASE)-diff.pdf: $(TEX_ALL) $(GFX_FILES) $(GNUPLOT_FILES) $(BIB_FILES)
$(PDFLATEX) "\\def\\isDiff{1} \\input{$(TEX_MAIN)}"
-$(BIBTEX) $(MAIN)
$(PDFLATEX) "\\def\\isDiff{1} \\input{$(TEX_MAIN)}"
$(PDFLATEX) "\\def\\isDiff{1} \\input{$(TEX_MAIN)}"
mv $(MAIN).pdf $@

finalized: $(TARGET_BASE)-final.pdf

$(TARGET_BASE)-final.pdf: $(TEX_ALL) $(GFX_FILES) $(GNUPLOT_FILES) $(BIB_FILES)
$(PDFLATEX) "\\def\\isFinalized{1} \\input{$(TEX_MAIN)}"
-$(BIBTEX) $(MAIN)
$(PDFLATEX) "\\def\\isFinalized{1} \\input{$(TEX_MAIN)}"
$(PDFLATEX) "\\def\\isFinalized{1} \\input{$(TEX_MAIN)}"
mv $(MAIN).pdf $@

spellcheck:

################################################################################
# File -> File Rules

%.pdf: %.eps
$(EPS_TO_PDF) $<

%.pdf: %.obj
$(OBJ_TO_EPS) $< | \
$(EPS_TO_PDF) -f -o=$@

%.pdf: %.p
$(GNUPLOT) $< | \
$(EPS_TO_PDF) -f -o=$@

Loading