Commit 937d0d92 authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

FIX: unsigned long int to std::size_t for nbOfNodesInImage in GetAutomaticConfiguration()

parent 555fe98c
......@@ -314,11 +314,12 @@ void Controller<TSegmenter>::GetAutomaticConfiguration()
// TODO: Use the smallest number amongst MPI processes
unsigned long int maximumNumberOfNodesInMemory = GetMaximumNumberOfNodesInMemory();
itkDebugMacro(<<"Maximum number of nodes in memory is " << maximumNumberOfNodesInMemory);
std::cout <<"Maximum number of nodes in memory is " << maximumNumberOfNodesInMemory << std::endl;
// Number of nodes in the entire image
const unsigned int imageWidth = m_InputImage->GetLargestPossibleRegion().GetSize()[0];
const unsigned int imageHeight = m_InputImage->GetLargestPossibleRegion().GetSize()[1];
const unsigned long int nbOfNodesInImage = imageWidth*imageHeight;
const std::size_t imageWidth = m_InputImage->GetLargestPossibleRegion().GetSize()[0];
const std::size_t imageHeight = m_InputImage->GetLargestPossibleRegion().GetSize()[1];
const std::size_t nbOfNodesInImage = imageWidth*imageHeight;
// Default layout: 1x1
m_NbTilesX = 1;
......@@ -329,6 +330,7 @@ void Controller<TSegmenter>::GetAutomaticConfiguration()
// Actually, there is tile margins. And the best scenario is to have
// square tiles with margin = width/2, that is tiles 4x larger.
// Hence the number of tiles maximizing memory use is 4x larger.
std::cout << "nb " << nbOfNodesInImage << std::endl;
unsigned int minimumNumberOfTiles = std::ceil(4.0 * ((float) nbOfNodesInImage) / ((float) maximumNumberOfNodesInMemory));
itkDebugMacro(<<"Minimum number of tiles is " << minimumNumberOfTiles);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment