Open KrisThielemans opened 4 years ago
should the BinNormalisation also use STIR_OPENMP_PROJECTIONS?
not sure if there's any openmp in there (maybe in the ...FromAttenuationImage
one?) But as these are not using distributable_computation
, we wouldn't have a conflict anyway. so, the answer is no.
maybe we should rename this to STIR_OPENMP_DISTRIBUTABLE
, but that won't be terribly clear for users. suggestions welcome.
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 toSTIR_OPENMP
), change the code indistributable.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 tofalse
) 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
andcmake/STIRConfig.h.in