BSPLib

BSPLib is a fast, and easy to use C++ implementation of the Bulk Synchronous Parallel (BSP) threading model. This model is mainly used in the scientific computing field, but can also be applied more general in computer science. This library includes an extended version the standard BSP interface to perform better, and made it more easy to use.

Status

Type Status
Linux & OSX Build Status
Windows Build status
Coverage codecov

BSP

The BSP specification can be found here and is maintained by bsp-worldwide.org. Parts of the documentation and code are based off this specification, to ensure backward compatibility between BSP libraries.

ZPM Installation

In .package.json

"requires": [
        {
            "name": "Zefiros-Software/BSPLib",
            "version": "^1.1.0"
        }
]

In premake5.lua

zpm.uses "Zefiros-Software/BSPLib"

Manual Installation

The whole library is header only, so for usage in your own code you should clone the repository. And add bsp/include/ as include path. After this you can use the include #include "bsp/bsp.h" in your code to start using the library.

Code & Documentation

The code can be found here. See this for the documentation.

Features

Usage

For detailed usage, please visit BSPLib.

Example

void main( int32_t, const char ** )
{
    BSPLib::Execute( []
    {
        std::cout << "Hello BSP Worldwide from process " << BSPLib::ProcId() 
                  << " of " << BSPLib::NProcs() << std::endl;
    }, BSPLib::NProcs() );
}

Flexibility

Don't like the legacy interface?

No worries! You can easily disable the macros by defining:

#define BSP_DISABLE_LEGACY

Speeding up debugging

When debug builds are too slow, you can remove the extra safety check by defining:

#define BSP_SKIP_CHECKS

BSPLib Limits

Planned Features

BSPedupack

As an example usage of the BSP programming model we included the BSPedupack written by Rob H. Bisseling with his permission. It includes some tools to benchmark and test the library on different machines, to quote from his own site:

BSPedupack is a library of numerical algorithms written in C according to the BSP model. It uses the BSPlib standard library. The 'edu' in the name stands for educational. The programs are intended for teaching: they give examples of portable parallel numerical programs. The trade-off between clarity/brevity on the one hand, and efficiency on the other hand is in favour of clarity/brevity. There is also an MPI version which teaches how to program in bulk synchronous parallel style using the collective communications from MPI-1 and the one-sided communications from MPI-2. You guessed it, this package is called MPIedupack. Both packages accompany the book: Parallel Scientific Computation: A Structured Approach using BSP and MPI, by Rob H. Bisseling, Oxford University Press, March 2004. ISBN 978-0-19-852939-2.

Alternatives

Why BSPLib?

We wanted an easy to use, high performing BSP model implementation, but of course there were some alternatives.

BSPLib vs MulticoreBSP

BSPLib vs Oxford BSP Toolkit

BSPLib vs BSPonMPI

Bugs

When a bug is found, please insert it in the issue tracker, so we can resolve it as quickly as we can.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Authors

Used By

We are interested to find out what projects use BSPLib. We would love to include your projects here, just shoot us a mail. :)

Citing BSPLib

When you use BSPLib as part of a scientific publication, we would love you to cite this project. This BibTex snippet can be used:

@misc{bsplib2016,
  author    = {Mick van Duijn and Koen Visscher and Paul Visscher},
  title     = {{BSPLib}: a fast, and easy to use {C++} implementation of the {Bulk} {Synchronous} {Parallel} ({BSP}) threading model.},
  abstract  = {{BSPLib} is a fast, and easy to use {C++} implementation of the {Bulk} {Synchronous} {Parallel} ({BSP}) threading model. This model is mainly used in the scientific computing field, but can also be applied more general in computer science. This library includes an extended version the standard BSP interface to perform better, and made it more easy to use.},
  howpublished = {\url{http://bsplib.eu/}}
}

License

This project is licensed under the MIT license by Zefiros Software.

Copyright (c) 2016 Mick van Duijn, Koen Visscher and Paul Visscher

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.