UCL / UCL/STIR

openmp changes to allow projection matrix parallelisation

Open
#458 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
160
Forks
113
Avg merge
12d 15h
Merged PRs (30d)
1

Description

At present, for SPECTUB there is a problem that when doing forward projection, gradient calculations etc, the code wants to use multi-threading, but the SPECTUB matrix cannot (unless all views are cached, but it is then still very ineffective).

On the other hand, the matrix calculation itself could be parallelisable.

One way to achieve this would be to

  • create an extra CMake variable, STIR_OPENMP_PROJECTIONS (set by default to STIR_OPENMP), change the code in distributable.cxx, ForwardProjectorByBin.cxx etc to use that variable, such that it can be disabled, while still using OPENMP in the rest of the code.

  • create another variable STIR_OPENMP_MATRIX (set by default to false) that enables then any projector parallelisations.

Another advantage of this would be that it would enable MPI/GPU and OPENMP to be used together.

CMake variables would need to be set in src/CMakeLists.txt and cmake/STIRConfig.h.in

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/CMakeLists.txt and cmake/STIRConfig.h.in to trace how STIR_OPENMP is configured, then inspect distributable.cxx and ForwardProjectorByBin.cxx. Done means projection OpenMP can be disabled independently, matrix parallelisation can be enabled separately, and the requested defaults support combining MPI, GPU and OpenMP.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, hpc, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.