From 68eaa698d902d2e0d5c97ea6d0b1dde470f4e894 Mon Sep 17 00:00:00 2001
From: "raffaele.gaetano" <raffaele.gaetano@cirad.fr>
Date: Tue, 11 Dec 2018 16:31:00 +0100
Subject: [PATCH] Working on the resume option to resume segmentation after
 fail or abort.

---
 include/lsgrmController.txx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/lsgrmController.txx b/include/lsgrmController.txx
index 386c510..df4814a 100644
--- a/include/lsgrmController.txx
+++ b/include/lsgrmController.txx
@@ -92,8 +92,10 @@ void Controller<TSegmenter>::RunSegmentation()
     // Run first partial segmentation
     boost::timer t; t.restart();
 	
+	auto accumulatedMemory = 0;
+	
     if (!m_Resuming) {
-	auto accumulatedMemory = RunFirstPartialSegmentation<TSegmenter>(
+	accumulatedMemory = RunFirstPartialSegmentation<TSegmenter>(
         m_InputImage,
         m_SpecificParameters,
         m_Threshold,
@@ -107,7 +109,7 @@ void Controller<TSegmenter>::RunSegmentation()
         isFusion);
 	} else {
 		// temp. patch, maybe calculate real current memory after resuming graphs.
-		auto accumulatedMemory = 2 * m_Memory;
+		accumulatedMemory = 2 * m_Memory;
 	}
 
 #ifdef OTB_USE_MPI
-- 
GitLab