Skip to content
Phillip Allen Lane edited this page Nov 27, 2023 · 9 revisions

What is DotMP?

DotMP is a .NET library for efficient parallel programming. It is heavily inspired by OpenMP, so users familiar with both OpenMP and C# should find most of DotMP to be very familiar. However, there are some key differences which this Wiki aims to outline, as well as providing a tutorial for new users.

Structure of this Wiki

This wiki is separated into two sections, and further into chapters, with the idea that if you have a background in parallel programming and read the chapters in-order, you should be fluent in DotMP in no time.

The first section is for DotMP CPU programming, which has been the focus the vast majority of DotMP's lifespan. The CPU chapters are organized as follows:

  1. Creating parallel regions and understanding the fork-join paradigm of DotMP
  2. Data parallelism with parallel for loops
  3. Implementing custom schedulers for parallel for loops
  4. Other miscellaneous but useful constructs you can use within parallel regions
  5. Helper methods to let you interface with the DotMP runtime
  6. The locking API
  7. The atomics API
  8. The shared memory API
  9. The tasking subsystem and using task-based parallelism

The second section is for DotMP GPU programming, which is an experimental feature that is coming in DotMP v2.0. The GPU chapters are organized as follows:

  1. The GPU memory model, moving memory, and accessing memory
  2. Data parallelism with parallel for loops

Installing DotMP

The easiest way to install DotMP is from the NuGet package manager:

dotnet add package DotMP

Building DotMP from Source

First, clone DotMP and navigate to the source directory:

git clone https://github.com/computablee/DotMP.git
cd DotMP

DotMP can be built using the make command. To build the entire project, including all tests, examples, and documentation, run the following command:

make

This command will build the main library, all tests, examples, benchmarks, and the documentation into their respective directories, but will not run any tests.

To build only the main library, run the following command:

make build

To build only the tests, run the following command:

make tests

To run the tests, run the following command:

make test

To build only the examples, run the following command:

make examples

This will build all of the examples, including the native C# parallelized, the DotMP parallelized, and the sequential examples. You can also individually build each of these classes of examples by running one or all of the following commands:

make examples-cs
make examples-dmp
make examples-seq

To build only the benchmarks, ruin the following command:

make benches

You can use Doxygen to build the documentation for this project. A Doxyfile is located in the root of the project directory. To build the documentation, run the following command:

make docs

This will generate documentation in the root of the project under the docs directory in both LaTeX and HTML formats. A copy of the most up-to-date documentation is hosted on GitHub.