Skip to content
Snippets Groups Projects
Commit 010dc976 authored by Dominik Smith's avatar Dominik Smith
Browse files

Applied PODVector in cbm::algo::tof::Hitfind. Modified compat/OpenMP.h.

parent 7d6e5ce5
No related branches found
No related tags found
1 merge request!1494OpenMP parallelization of cbm::algo::tof::Hitfind.
Pipeline #25650 passed
......@@ -45,10 +45,12 @@ namespace cbm::algo::openmp
#ifndef HAVE_OMP
inline int GetMaxThreads() { return 1; }
inline int GetThreadNum() { return 0; }
inline int GetNumThreads() { return 1; }
inline void SetNumThreads(int) {}
#else
inline int GetMaxThreads() { return omp_get_max_threads(); }
inline int GetThreadNum() { return omp_get_thread_num(); }
inline int GetNumThreads() { return omp_get_num_threads(); }
inline void SetNumThreads(int n) { omp_set_num_threads(n); }
#endif
......
......@@ -97,9 +97,9 @@ namespace cbm::algo::tof
}
monitor.fSortTime = xpu::pop_timer();
std::vector<Hit> clustersFlat; // cluster storage
std::vector<size_t> chanSizes; // nClusters per channel
std::vector<u32> chanAddresses; // channel addresses
PODVector<Hit> clustersFlat; // cluster storage
PODVector<size_t> chanSizes; // nClusters per channel
PODVector<u32> chanAddresses; // channel addresses
// Prefix arrays for parallelization
std::vector<size_t> cluPrefix;
......@@ -111,14 +111,8 @@ namespace cbm::algo::tof
xpu::t_add_bytes(digiIn.size_bytes());
#pragma omp parallel
{
#ifdef _OPENMP
int ithread = omp_get_thread_num();
int nthreads = omp_get_num_threads();
#else
int ithread = 0;
int nthreads = 1;
#endif
const int ithread = openmp::GetThreadNum();
const int nthreads = openmp::GetNumThreads();
#pragma omp single
{
......
......@@ -17,8 +17,10 @@
#include <xpu/host.h>
#include "PODVector.h"
#include "PartitionedVector.h"
namespace cbm::algo::tof
{
......@@ -52,7 +54,7 @@ namespace cbm::algo::tof
class Hitfind {
public:
typedef std::tuple<PartitionedVector<Hit>, HitfindMonitorData, std::vector<i32>> resultType;
typedef std::tuple<PartitionedVector<Hit>, HitfindMonitorData, PODVector<i32>> resultType;
/** @brief Algorithm execution
** @param fles timeslice to hitfind
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment