Code Monkey home page Code Monkey logo

sort_forests's Introduction

Sort_Forests

Description

Sorts Consistent Tree outputs into contiguous order. Written in C, probably only works on Linux.

Motivation

Consistent tree output is spread out over various tree_*_*_*.dat files with a locations.dat file specifying the tree_root_id, fileid and offset to read in the data. Sort_Forests resorts the entire data-set such that all forests are grouped contiguously in the same file -- speeding up IO.

The code is written to be very fast and uses lower level system calls (pread instead of fseek/fgets combo). For instance, rewriting entire 1.2 TB of Bolshoi trees takes 12 hours on a single cpu.

Installation

Pre-requisites

  1. A C compiler (gcc/icc/clang). gcc is default.

Compiling

$ git clone https://github.com/manodeep/sort_forests/
$ make

Running

$ ./sort_forests <input directory> <output directory>

Input directory should contain forests.list, locations.dat and tree_*_*_*.dat files. Output directory will contain the new forests.list, locations.dat and tree_*_*_*.dat files. In addition, the output directory also contains forests_and_locations_new.dat file that contains forest id, tree_root_id, fileid, offset, filename and a new column bytes that gives the number of (ASCII) bytes in each tree. This bytes column will let you pre-allocated a buffer for a tree and read in the entire tree in one go (rather than line by line).

Author

Sort_Forests is written/maintained by Manodeep Sinha. Please contact the author in case of any issues.

LICENSE

Sort_Forests is released under the MIT license. Basically, do what you want with the code including using it in commercial application.

Project URL

sort_forests's People

Contributors

manodeep avatar

Watchers

 avatar  avatar

sort_forests's Issues

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.