Skip to content

Commit

Permalink
quickbook documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtapia committed Jan 13, 2017
1 parent 164eed5 commit d07be0e
Show file tree
Hide file tree
Showing 367 changed files with 7,671 additions and 4,282 deletions.
42 changes: 42 additions & 0 deletions Jamfile.v2
@@ -0,0 +1,42 @@
# Copyright Steven Ross 2009.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# See http://www.boost.org/libs/sort for library home page.

local properties = ;
if --tune in [ modules.peek : ARGV ]
{
properties = <location>. <variant>release ;
}

project spreadsort : source-location example : requirements <include>../.. <include>../../.. $(properties) ;

exe spreadsort : sample.cpp ;
exe alreadysorted : alreadysorted.cpp ;
exe mostlysorted : mostlysorted.cpp ;
exe rightshift : rightshiftsample.cpp ;
exe reverseintsort : reverseintsample.cpp ;
exe int64 : int64.cpp ;
exe floatsort : floatsample.cpp ;
exe shiftfloatsort : shiftfloatsample.cpp ;
exe floatfunctorsort : floatfunctorsample.cpp ;
exe double : double.cpp ;
exe stringsort : stringsample.cpp ;
exe wstringsort : wstringsample.cpp ;
exe reversestringsort : reversestringsample.cpp ;
exe charstringsort : charstringsample.cpp ;
exe stringfunctorsort : stringfunctorsample.cpp ;
exe reversestringfunctorsort : reversestringfunctorsample.cpp ;
exe keyplusdata : keyplusdatasample.cpp ;
exe randomgen : randomgen.cpp ;
exe boostrandomgen : boostrandomgen.cpp ;
exe alrbreaker : alrbreaker.cpp ;
exe binaryalrbreaker : binaryalrbreaker.cpp ;
exe caseinsensitive : caseinsensitive.cpp ;
exe generalizedstruct : generalizedstruct.cpp ;

# benchmarks need to be built with linkflags="-lboost_system -lboost_thread"
#exe parallelint : parallelint.cpp boost_system ;
#exe parallelstring : parallelstring.cpp ;
27 changes: 14 additions & 13 deletions README.md
Expand Up @@ -4,9 +4,9 @@

<h3>PRELIMINARY</h3>

The **Boost Sort Parallel Library**, had been designed to be included in the Boost Sort Library, created by Steven Ross, which actually have the SpreadSort algorithms.
The **Boost Sort Parallel Library**, is part of the Boost Sort Library, created by Steven Ross.


This library is pending of the final approval to be included in the Boost Sort Libray, due this, can suffer some changes until the final version and definitive approval in the Boost Library.

<h3>DESCRIPTION</h3>

Expand Down Expand Up @@ -65,6 +65,7 @@ With a small number of threads, have similar speed than the subdivision algorith
- Microsoft PPL Parallel Buffered Sort

<h3>NEW PARALLEL SORT ALGORITHM</h3>

This generate an **undesirable duality**. With a small number of threads use one algorithm, and with a big number use other. Due this, the SW designed for a small machine is inadequate for a big machine and vice versa. But the main problem, in the merging algorithms is the memory used, usually of the same size than the data.

This version have as novelty a **new parallel\_sort algorithm** *( internally named Block Indirect)*, created for processors connected with **shared memory**.
Expand All @@ -73,10 +74,12 @@ It is a hybrid algorithm. With small number of threads, it is a subdivision algo

The block_size is an internal parameter of the algorithm, which in order to achieve the highest speed, change according the size of the objects to sort according the next table. The **strings** use a block_size of 128.


| object size (bytes) |1 - 15| 16 - 31 | 32 - 63 | 64 - 127 | 128 - 255 | 256 - 511 | 512 - |
| --- | --- | --- | --- | --- | --- | --- | --- |
| block_size |4096 |2048 | 1024| 768 | 512 | 256 | 128 |


This algorithm permit to eliminate the duality. When run in a machine with small number of threads have the performance of TBB, and when run in a machine with many threads, the same code have the performance of GCC Parallel Sort, with the **additional advantage** of the **small memory consumption**.

The algorithm use as **auxiliary memory a block_size elements** for each thread. The worst case is when have very big elements and many threads. With big elements (512 bytes), and 12 threads, The memory measured was:
Expand All @@ -87,18 +90,13 @@ The algorithm use as **auxiliary memory a block_size elements** for each thread.
| Threading Building Blocks (TBB) | 783 MB |
| Block Indirect Sort | 812 MB |

*This **new parallel\_sort algorithm had been created and implemented specifically for this library** by the author.*

*You can obtain more information in the Documentation Page of the Project * [index.html](index.html)

*If you are interested in a brief description of the algorithm, you can find in the next link*
[(block_indirect_sort_brief_en.pdf)](block_indirect_sort_brief_en.pdf)
*This **new parallel\_sort algorithm had been created and implemented specifically for this library** by the author.*

*If you are interested in a detailed description of the algorithm, you can find in the next link*
[(block_indirect_sort_en.pdf)](block_indirect_sort_en.pdf)
*In the documentation of the project, you can find all the information about the algorithm ( description, characteristics, how to program, and articles with the detailed description of the new algorithm) [index.html](index.html)

*If you want run the benchmarks in your machine, you have all the code, intructions and procedures in*
<a href="https://github.com/fjtapia/sort_parallel_benchmark">https://github.com/fjtapia/sort_parallel_benchmark</a>
*In the project you have a small benchmarks. If you want run in your machine the full benchmarks with non free SW, you have all the code, intructions and procedures in
[(https://github.com/fjtapia/sort_parallel_benchmark)](https://github.com/fjtapia/sort_parallel_benchmark)

<h2>Installation </h2>
* This library is **include only**.
Expand All @@ -114,15 +112,18 @@ The algorithm use as **auxiliary memory a block_size elements** for each thread.
| Visual C++ 2013, 2015 |



<h2>Author and Copyright</h2>
This library had been create to be integrated in the [Boost](http://www.boost.org) library, inside the [boost::sort library](http://www.boost.org/doc/libs/release/libs/sort),

This library is integrated in the [Boost](http://www.boost.org) library, inside the [boost::sort library](http://www.boost.org/doc/libs/release/libs/sort),
with the spreadsort algorithms designed and implemented by Steven Ross.

It's pending of the final approval, due this can suffer some changes until the final version and definitive approval in the boost library. You can find in [https://github.com/fjtapia/sort_parallel](https://github.com/fjtapia/sort_parallel)
You can find in [https://github.com/fjtapia/sort_parallel](https://github.com/fjtapia/sort_parallel)

This algorithm had been ideate, designed and implemented beginning from zero. After read hundreds of articles and books, I didn't find any similar. If someone knows something about this or something similar, please, say me.

Anyway, the important is not the author, is provide a fast, robust, and easy to use algorithm to the community of programmers.


Copyright 2016 [Francisco Tapia *(fjtapia@gmail.com)* ](mail:fjtapia@gmail.com)
Distributed under the [Boost Software License, Version 1.0. ](http://www.boost.org/LICENSE_1_0.txt) (See http://www.boost.org/LICENSE_1_0.txt)
106 changes: 106 additions & 0 deletions doc/Jamfile.v2
@@ -0,0 +1,106 @@
# Spreadsort documentation Jamfile
# Copyright (c) 2014 Steven Ross
#
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://boost.org/LICENSE_1_0.txt)

# Reminder: whitespace MUST terminate variable name!
# so spaces or newlines BEFORE ; and : and AFTER too.
# (because : and ; are keywords!)

import doxygen ;
import quickbook ;
import os ; # Needed to get environment variables.
import modules ;

path-constant here : . ; # convenient to refer to files in the same directory as this jamfile.v2
path-constant boost-images : ../../../doc/src/images ;
path-constant images_location : . ; # location of SVG and PNG images referenced by Quickbook.
# http://docbook.sourceforge.net/release/xsl/1.77.1/doc/html/img.src.path.html
# relative to /doc ?

path-constant parent : .. ; # Beman Dawes - so that inspect.exe will start in boost-root/libs/timer
# when run from another directory, such as boost-root/status
using auto-index ;
using doxygen ; # Required if you want to use Doxygen.
using quickbook ;
using boostbook ;




xml sort
:
parallel_sort.qbk # This is your 'root' Quickbook file (that may include other .qbk files).
;

boostbook standalone
:
sort
:
# http://www.sagehill.net/docbookxsl/SectionNumbering.html
<xsl:param>boost.root=../../../.. # modular-boost
<xsl:param>chapter.autolabel=0 # No Chapter numbering.
<xsl:param>chunk.section.depth=8
<xsl:param>toc.section.depth=8 # How far down sections get TOCs.
<xsl:param>toc.max.depth=4 # Max depth in each TOC.
<xsl:param>generate.section.toc.level=1


# PDF Options:
# TOC Generation: this is needed for FOP-0.9 and later:
<xsl:param>fop1.extensions=0
<xsl:param>xep.extensions=1
# TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
<xsl:param>fop.extensions=1
# No indent on body text:
<xsl:param>body.start.indent=0pt
# Margin size:
<xsl:param>page.margin.inner=0.5in
# Margin size:
<xsl:param>page.margin.outer=0.5in
# Paper type = A4
<xsl:param>paper.type=A4
# Yes, we want graphics for admonishments:
<xsl:param>admon.graphics=1
#<format>html:<xsl:param>img.src.path=$(images_location)/
# Default works for html, need ./doc for PDF
# Set this one for PDF generation *only*:
# default png graphics are awful in PDF form,
# better use SVGs instead, if available:

<format>pdf:<xsl:param>img.src.path=$(images_location)/
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
<format>pdf:<xsl:param>admon.graphics.path=$(boost-images)/

<dependency>autodoc #

;

install pdfinstall
: standalone
: <location>. <install-type>PDF <name>sort.pdf
;
explicit css ;
explicit images ;

# This will run the inspect tool automatically from the doc folder
# but sadly seems to build the tool each time so is very slow.
# Also it produces lots of output from the original docs.
# So not very useful yet.

# Run inspect tool.
# run /boost/tools/inspect//inspect/<variant>release
# : $(parent) -text -brief # command line
# : # input files
# : <dependency>/boost/filesystem//boost_filesystem
# <test-info>always_show_run_output # requirements
# : inspect # test name
# ;

###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : standalone ;
explicit boostrelease ;

0 comments on commit d07be0e

Please sign in to comment.