From 36202ffda4bbe67d5a44ba7c7f12b8bdaa4f1892 Mon Sep 17 00:00:00 2001 From: Giovanni La Mura Date: Mon, 2 Dec 2024 15:12:23 +0100 Subject: [PATCH] Put refinement set up information under the iteration data constructors --- src/cluster/cluster.cpp | 5 ----- src/inclusion/inclusion.cpp | 11 ++++++----- src/libnptm/Commons.cpp | 6 ++++++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index 4f606908..1b320af2 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -317,12 +317,7 @@ void cluster(const string& config_file, const string& data_file, const string& o // do the first iteration on jxi488 separately, since it seems to be different from the others int jxi488 = 1; - // In the first iteration, if refinement is enabled, determine the number of refinement iterations required to arrive at the target accuracy (if achievable in a reasonable number of iterations) - cid->refinemode = 2; - // maxrefiters and accuracygoal should be configurable and preferably set somewhere else - cid->maxrefiters = 20; int initialmaxrefiters = cid->maxrefiters; - cid->accuracygoal = 1e-6; chrono::time_point start_iter_1 = chrono::high_resolution_clock::now(); #ifdef USE_NVTX nvtxRangePush("First iteration"); diff --git a/src/inclusion/inclusion.cpp b/src/inclusion/inclusion.cpp index 5d15de2a..8b01327c 100644 --- a/src/inclusion/inclusion.cpp +++ b/src/inclusion/inclusion.cpp @@ -302,6 +302,12 @@ InclusionIterationData::InclusionIterationData(GeometryConfiguration *gconf, Sca #else proc_device = 0; #endif + + // In the first iteration, if refinement is enabled, determine the number of refinement iterations required to arrive at the target accuracy (if achievable in a reasonable number of iterations) + refinemode = 2; + // maxrefiters and accuracygoal should be configurable and preferably set somewhere else + maxrefiters = 20; + accuracygoal = 1e-6; } InclusionIterationData::InclusionIterationData(const InclusionIterationData& rhs) { @@ -961,12 +967,7 @@ void inclusion(const string& config_file, const string& data_file, const string& // do the first iteration on jxi488 separately, since it seems to be different from the others int jxi488 = 1; - // In the first iteration, if refinement is enabled, determine the number of refinement iterations required to arrive at the target accuracy (if achievable in a reasonable number of iterations) - cid->refinemode = 2; - // maxrefiters and accuracygoal should be configurable and preferably set somewhere else - cid->maxrefiters = 20; int initialmaxrefiters = cid->maxrefiters; - cid->accuracygoal = 1e-6; chrono::time_point start_iter_1 = chrono::high_resolution_clock::now(); #ifdef USE_NVTX diff --git a/src/libnptm/Commons.cpp b/src/libnptm/Commons.cpp index eb0d5a95..126ca007 100644 --- a/src/libnptm/Commons.cpp +++ b/src/libnptm/Commons.cpp @@ -160,6 +160,12 @@ ClusterIterationData::ClusterIterationData(GeometryConfiguration *gconf, Scatter #else proc_device = 0; #endif + + // In the first iteration, if refinement is enabled, determine the number of refinement iterations required to arrive at the target accuracy (if achievable in a reasonable number of iterations) + refinemode = 2; + // maxrefiters and accuracygoal should be configurable and preferably set somewhere else + maxrefiters = 20; + accuracygoal = 1e-6; } ClusterIterationData::ClusterIterationData(const ClusterIterationData& rhs) { -- GitLab