Commit a8bff198 authored by Philipp Götze's avatar Philipp Götze
Browse files

Moved scripts and fixed benchmarks

parent 70a14753
#!/bin/bash
### LOCATIONS ###
REPO_ROOT=$PWD
BUILD_DIR=build
DATA=/mnt/mem/test/tree_bench.data
OUTPUT_FILE=$REPO_ROOT/results/writes.csv
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/writes.csv
### CUSTOMIZABLE PARAMETERS ###
bsize=512
......
#!/bin/bash
### LOCATIONS ###
REPO_ROOT=$PWD
BUILD_DIR=build
DATA=/mnt/mem/test/tree_bench.data
OUTPUT_FILE=$REPO_ROOT/results/bytesWritten.csv
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/bytesWritten.csv
### CUSTOMIZABLE PARAMETERS ###
bsize=512
......
#!/bin/bash
### LOCATIONS ###
REPO_ROOT=$PWD
BUILD_DIR=build
DATA=/mnt/mem/test/tree_bench.data
OUTPUT_FILE=$REPO_ROOT/results/testing.csv
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/testing.csv
### CUSTOMIZABLE PARAMETERS ###
bsize=512
depth=1
#LEAF_SIZES=( 256 512 1024 2048 4096 )
LEAF_SIZES=( 1024 )
TREE="FP" #FP/PBP/Unsorted/wBP
TREE_BASE="FP" #FP/PBP/wBP
LEAF_SIZES=( 256 512 1024 2048 4096 )
TREE="PBP" #FP/PBP/Unsorted/wBP
TREE_BASE="PBP" #FP/PBP/wBP
SUFFIX="" # in case of binary vs. linear
### Do not change anything following here!!! ###
......
#!/bin/bash
### LOCATIONS ###
REPO_ROOT=$PWD
BUILD_DIR=build
DATA=/mnt/mem/test/tree_bench.data
OUTPUT_FILE=$REPO_ROOT/results/split2.csv
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/split2.csv
### CUSTOMIZABLE PARAMETERS ###
bsize=512
......
#!/bin/bash
### LOCATIONS ###
REPO_ROOT=$PWD
BUILD_DIR=build
DATA=/mnt/mem/test/tree_bench.data
OUTPUT_FILE=$REPO_ROOT/results/traverseMemory.csv
REPO_ROOT=$PWD/..
BUILD_DIR=$REPO_ROOT/build
DATA=/mnt/pmem/test/tree_bench.data
OUTPUT_FILE=$PWD/results/traverseMemory.csv
### CUSTOMIZABLE PARAMETERS ###
keypos="middle" #first/middle/last
lsize=512
BRANCH_SIZES=( 256 512 1024 2048 4096 )
DEPTHS=(1 2 3 4)
TREE="FP" #FP/PBP/wBP/wHBP
TREE_BASE="FP" # for namespace and numKeys determination
TREE="PBP" #FP/PBP/wBP/wHBP
TREE_BASE="PBP" # for namespace and numKeys determination
SUFFIX="_b" # in case of binary vs. linear
### Do not change anything following here!!! ###
......@@ -53,7 +53,7 @@ do
OUTPUT="$(sh -c 'bench/tree_traverse --benchmark_format=csv' 2> /dev/null | tail -3)"
elements="$(echo "$OUTPUT" | head -1 | cut -d ':' -f2)"
time="$(echo "$OUTPUT" | tail -1 | cut -d ',' -f4)"
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$memory" >> $OUTPUT_FILE
echo "${TREE}Tree$SUFFIX,$elements,$lsize,$bsize,$depth,$fillratio,$keypos,$time" >> $OUTPUT_FILE
done
popd > /dev/null
done
......
......@@ -6,7 +6,7 @@ project (nvm-DS)
################################################################################
# Set the mount path of your pmem device where the structures should be stored
set(PMEM_MNT_PATH "/mnt/mem/test")
set(PMEM_MNT_PATH "/mnt/pmem/test")
# Installation path (creates include and lib within this directory)
if(NOT PROJECT_INSTALL_DIR)
......
......@@ -27,9 +27,9 @@
#define UNIT_TESTS
#include "benchmark/benchmark.h"
#include "FPTree.hpp"
#include "PBPTree.hpp"
using namespace dbis::fptree;
using namespace dbis::pbptree;
using pmem::obj::pool;
......@@ -38,7 +38,7 @@ using pmem::obj::pool;
using MyTuple = std::tuple <int, int, double>;
using MyKey = unsigned long long;
constexpr auto TARGET_BRANCH_SIZE = 512;
constexpr auto TARGET_LEAF_SIZE = 1024; //< 512B best performance
constexpr auto TARGET_LEAF_SIZE = 512; //< 512B best performance
constexpr auto TARGET_DEPTH = 1;
const std::string path = dbis::gPmemPath + "tree_bench.data";
constexpr auto POOL_SIZE = 1024 * 1024 * 1024 * 4ull; //< 4GB
......@@ -104,12 +104,12 @@ constexpr uint64_t ipow(uint64_t base, int exp, uint64_t result = 1) {
}
/* Tree relevant calculated parameters*/
constexpr auto LEAFKEYS = getLeafKeysFPTree<5>(); //< 5 iterations should be enough
constexpr auto BRANCHKEYS = getBranchKeysFPTree<5>();
constexpr auto LEAFKEYS = getLeafKeysPBPTree<5>(); //< 5 iterations should be enough
constexpr auto BRANCHKEYS = getBranchKeysPBPTree<5>();
constexpr auto ELEMENTS = LEAFKEYS*ipow(BRANCHKEYS+1, TARGET_DEPTH);
constexpr auto KEYPOS = ELEMENTS/1;
constexpr auto KEYPOS = ELEMENTS/2;
using TreeType = FPTree<MyKey, MyTuple, BRANCHKEYS, LEAFKEYS>;
using TreeType = PBPTree<MyKey, MyTuple, BRANCHKEYS, LEAFKEYS>;
/*=== Insert Function ===*/
void insert(persistent_ptr<TreeType> &tree) {
......
......@@ -39,7 +39,7 @@ static void BM_TreeGet(benchmark::State &state) {
} else {
LOG("Warning: " << path << " already exists");
pop = pool<root>::open(path, LAYOUT);
pop.root()->tree->recover(); //< hybrids only
//pop.root()->tree->recover(); //< hybrids only
}
auto tree = pop.root()->tree;
//tree->printBranchNode(0, tree->rootNode.branch);
......@@ -48,12 +48,12 @@ static void BM_TreeGet(benchmark::State &state) {
auto node = tree->rootNode;
/* hybrid versions */
auto d = tree->depth;
while ( d-- > 0) node = node.branch->children[0];
//auto d = tree->depth;
//while ( d-- > 0) node = node.branch->children[0];
/* nvm-only trees */
//auto d = tree->depth.get_ro();
//while ( d-- > 0) node = node.branch->children.get_ro()[0];
auto d = tree->depth.get_ro();
while ( d-- > 0) node = node.branch->children.get_ro()[0];
auto leaf = node.leaf;
......
......@@ -65,7 +65,6 @@ static void BM_TreeTraverse(benchmark::State &state) {
}
//tree->printBranchNode(0, tree->rootNode.branch);
std::cout << "Elements:" << ELEMENTS << "\n";
std::cout << "Size" << sizeof(*tree) << "\n";
pop.close();
}
BENCHMARK(BM_TreeTraverse);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment