From e48edb870d8897f8db93f1aa5679148b3bbf08b5 Mon Sep 17 00:00:00 2001
From: Lukas Werner <lks.werner@fau.de>
Date: Mon, 12 Mar 2018 13:12:15 +0100
Subject: [PATCH] Read raytracing algorithm of choice from config file

---
 src/pe/raytracing/Raytracer.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/pe/raytracing/Raytracer.cpp b/src/pe/raytracing/Raytracer.cpp
index a3089922a..992734640 100644
--- a/src/pe/raytracing/Raytracer.cpp
+++ b/src/pe/raytracing/Raytracer.cpp
@@ -155,11 +155,20 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st
 
    blockAABBIntersectionPadding_ = config.getParameter<real_t>("blockAABBIntersectionPadding", real_t(0.0));
 
+   std::string raytracingAlgorithm = config.getParameter<std::string>("raytracingAlgorithm", "RAYTRACE_HASHGRIDS");
+   if (raytracingAlgorithm == "RAYTRACE_HASHGRIDS") {
+      setRaytracingAlgorithm(RAYTRACE_HASHGRIDS);
+   } else if (raytracingAlgorithm == "RAYTRACE_NAIVE") {
+      setRaytracingAlgorithm(RAYTRACE_NAIVE);
+   } else if (raytracingAlgorithm == "RAYTRACE_COMPARE_BOTH") {
+      setRaytracingAlgorithm(RAYTRACE_COMPARE_BOTH);
+   }
+      
    std::string reductionMethod = config.getParameter<std::string>("reductionMethod", "MPI_REDUCE");
    if (reductionMethod == "MPI_REDUCE") {
-      reductionMethod_ = MPI_REDUCE;
+      setReductionMethod(MPI_REDUCE);
    } else if (reductionMethod == "MPI_GATHER") {
-      reductionMethod_ = MPI_GATHER;
+      setReductionMethod(MPI_GATHER);
    }
       
    setupView_();
-- 
GitLab