GithubHelp home page GithubHelp logo

classicvalues / meadowlark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hewlettpackard/meadowlark

1.0 1.0 0.0 4.76 MB

a user-space library that implements a radix tree that allocates memory using the fabric-attached memory manager (Project Gull) and relies on fabric-attached memory atomic operations for transactional updates

License: Other

CMake 1.88% C++ 47.59% Makefile 0.28% C 48.06% Shell 1.74% Ruby 0.34% Python 0.11%

meadowlark's Introduction

Radix Tree

Contact: Yupu Zhang ([email protected])

Description

Radix Tree is a user-space library written in C++ that implements a radix tree that relies on fabric-attached memory (FAM) atomics, which are atomics primitives within a cache-incoherent memory-semantic fabric environment.

A radix tree (also known as a radix trie) is a space-optimized trie data structure, where the number of children of every internal node is at least the radix r of the radix tree, where r is a positive integer and a power of 2. Unlike in regular tries, edges can be labeled with sequences of elements as well as single elements, which makes radix trees much more efficient for small sets (especially if the strings are long) and for sets of strings that share long prefixes. As a result, radix trees are frequently used for efficiently storing and searching text and intrinsically hierarchical data.

FAM atomic operations permit programs to perform operations such as write, compare-and-store (analogous to compare-and-swap), or fetch-and-add on operands located in fabric-attached memory atomically. Use of these atomics permits programs running on multiple non-coherent SoCs in a shared FAM environment to transactionally update the radix tree in a controlled fashion.

Radix tree relies on the FAM-aware Non-Volatile Memory Manager (NVMM) library, which is available from https://github.hpe.com/labs/nvmm or https://github.com/HewlettPackard/gull.

Master Source

https://github.hpe.com/labs/radixtree (internal)

https://github.com/HewlettPackard/meadowlark (external)

Maturity

Radix Tree is still in alpha state. The basic functionalities are working, but performance is not optimized. One limitation of the current implementation is that the key length is fixed and can only be tuned at compile time.

Radix Tree runs on both NUMA and FAME (Fabric-Attached Memory Emulation) systems.

Dependencies

  • Install additional packages

    $ sudo apt-get install build-essential cmake libboost-all-dev
    
  • Install libpmem

    $ sudo apt-get install autoconf pkg-config doxygen graphviz
    $ git clone https://github.com/FabricAttachedMemory/nvml.git
    $ cd nvml
    $ make
    $ sudo make install
    
  • Install libfam-atomic

    $ cd ~
    $ sudo apt-get install autoconf autoconf-archive libtool
    $ sudo apt-get --no-install-recommends install asciidoc xsltproc xmlto
    $ git clone https://github.com/FabricAttachedMemory/libfam-atomic.git
    $ cd libfam-atomic
    $ bash autogen.sh
    $ ./configure
    $ make
    $ sudo make install
    
  • Install NVMM

    Radix Tree uses Non-Volatile Memory Manager (NVMM). Before building the radix tree, please download and build NVMM.

  • Setup FAME if you want to try Radix Tree on top of FAM

Build & Test

  1. Download the source code:

Internal:

$ git clone https://github.hpe.com/labs/radixtree.git

External:

$ git clone https://github.com/HewlettPackard/meadowlark.git
  1. Change into the source directory (assuming the code is at directory $RADIXTREE):
$ cd $RADIXTREE
  1. Point build system to NVMM (assuming NVMM is already compiled with or without FAME support)

    Set the environment variable ${CMAKE_PREFIX_PATH} to include the paths to the NVMM header and library files.

    For example, if NVMM is installed at /home/${USER}/projects/nvmm:

    $ export CMAKE_PREFIX_PATH=/home/${USER}/projects/nvmm/include:/home/${USER}/projects/nvmm/build/src
    
  2. Build

On CC-NUMA systems:

$ mkdir build
$ cd build
$ cmake .. -DFAME=OFF
$ make

On FAME:

$ mkdir build
$ cd build
$ cmake .. -DFAME=ON
$ make

The default build type is Release. To switch between Release and Debug:

$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ cmake .. -DCMAKE_BUILD_TYPE=Debug
  1. Test
$ make test

All tests should pass.

Demo on FAME

There is a demo program that creates and destroys radix trees, and issue put/get/destroy/list commands to a radix tree, given its root. Below are the steps to run the demo:

  1. Setup FAME with at least two nodes (e.g., node01 and node02)

  2. Install NVMM with FAME support on all nodes

  3. Install Radix Tree on all nodes at $RADIXTREE, with FAME support

  4. First log into one node, create a radix tree, and remember its root pointer ($ROOT_PTR):

$ cd $RADIXTREE/build/demo
$ ./demo_radix_tree 0 create_tree
  1. Then log into any node to exercise put/get/destroy/list commands. For example:

Log into node01, put a pair of key value: a 1

$ cd $NVMM/build/demo
$ ./demo_radix_tree $ROOT_PTR put a 1
$ ./demo_radix_tree $ROOT_PTR list

Log into node02, get the value of key a:

$ cd $NVMM/build/demo
$ ./demo_radix_tree $ROOT_PTR list
$ ./demo_radix_tree $ROOT_PTR get a

Usage

Please see demo/demo_radix_tree.cc

Extension: KVS library

A set of Key-Value-Store (KVS) APIs (put, get, and delete) are implemented on top of the radixtree library, thus turning it into a KVS library. Please see include/radixtree/kvs.h for the APIs and test/test_kvs.cc for examples.

Extension: Consistent DRAM caching

Based on current expectation, FAM will have higher load/store latency than DRAM. To further improve the performance of the KVS library, we are working on a DRAM caching layer (based on memcached) that caches key-value pairs in node-local DRAM for faster reads and ensures they are consistent and up-to-date even when they are being updated. For more details, see KVS-DRAM-Cache (https://github.hpe.com/labs/KVS-DRAM-Cache)

Extension: KVS server and KVS client

Since KVS-DRAM-Cache is based on memcached, we are able to utilize its server front-end to service client requests over the network through memcached protocols. On top of that, we build a simple cluster management layer that can organize multiple KVS servers as a single KVS cluster with different replication configurations (e.g., static partitioning, master-slave, dynamo-like, sharing). We also implement a simple client library that automatically routes a KVS request to a corresponding server. Please see bin/*.yaml for configuration setups and include/kvs_client/kvs_client.h for client APIs.

Notes

  • There is another implementation of RadixTree at branch "numa_radixtree" whose FAM-support is still work in progress

meadowlark's People

Contributors

yzhang-hpe avatar mashoodk avatar gautham-bhat-k avatar

Stargazers

Classic Values avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.