Skip to content
Snippets Groups Projects
Commit 0b737f3a authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rename local fcts

parent bfb73dff
No related branches found
No related tags found
1 merge request!232Cleanup in context of Simulation, Computation; *Element now inherits from IElement
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
namespace { namespace {
size_t getIndexStep(size_t total_size, size_t n_handlers) size_t indexStep(size_t total_size, size_t n_handlers)
{ {
ASSERT(total_size > 0); ASSERT(total_size > 0);
ASSERT(n_handlers > 0); ASSERT(n_handlers > 0);
...@@ -35,9 +35,9 @@ size_t getIndexStep(size_t total_size, size_t n_handlers) ...@@ -35,9 +35,9 @@ size_t getIndexStep(size_t total_size, size_t n_handlers)
return total_size % n_handlers ? ++result : result; return total_size % n_handlers ? ++result : result;
} }
size_t getStartIndex(size_t n_handlers, size_t current_handler, size_t n_elements) size_t startIndex(size_t n_handlers, size_t current_handler, size_t n_elements)
{ {
const size_t handler_size = getIndexStep(n_elements, n_handlers); const size_t handler_size = indexStep(n_elements, n_handlers);
const size_t start_index = current_handler * handler_size; const size_t start_index = current_handler * handler_size;
if (start_index >= n_elements) if (start_index >= n_elements)
return n_elements; return n_elements;
...@@ -46,7 +46,7 @@ size_t getStartIndex(size_t n_handlers, size_t current_handler, size_t n_element ...@@ -46,7 +46,7 @@ size_t getStartIndex(size_t n_handlers, size_t current_handler, size_t n_element
size_t batchSize(size_t n_handlers, size_t current_handler, size_t n_elements) size_t batchSize(size_t n_handlers, size_t current_handler, size_t n_elements)
{ {
const size_t handler_size = getIndexStep(n_elements, n_handlers); const size_t handler_size = indexStep(n_elements, n_handlers);
const size_t start_index = current_handler * handler_size; const size_t start_index = current_handler * handler_size;
if (start_index >= n_elements) if (start_index >= n_elements)
return 0; return 0;
...@@ -172,7 +172,7 @@ void ISimulation::runSimulation() ...@@ -172,7 +172,7 @@ void ISimulation::runSimulation()
const size_t n_batches = m_options.getNumberOfBatches(); const size_t n_batches = m_options.getNumberOfBatches();
const size_t current_batch = m_options.getCurrentBatch(); const size_t current_batch = m_options.getCurrentBatch();
const size_t batch_start = getStartIndex(n_batches, current_batch, total_size); const size_t batch_start = startIndex(n_batches, current_batch, total_size);
const size_t batch_size = batchSize(n_batches, current_batch, total_size); const size_t batch_size = batchSize(n_batches, current_batch, total_size);
if (batch_size == 0) if (batch_size == 0)
return; return;
...@@ -299,7 +299,7 @@ void ISimulation::runSingleSimulation(const ProcessedSample& re_sample, size_t b ...@@ -299,7 +299,7 @@ void ISimulation::runSingleSimulation(const ProcessedSample& re_sample, size_t b
for (size_t i_thread = 0; i_thread < n_threads; ++i_thread) { for (size_t i_thread = 0; i_thread < n_threads; ++i_thread) {
const size_t thread_start = batch_start + getStartIndex(n_threads, i_thread, batch_size); const size_t thread_start = batch_start + startIndex(n_threads, i_thread, batch_size);
const size_t thread_size = batchSize(n_threads, i_thread, batch_size); const size_t thread_size = batchSize(n_threads, i_thread, batch_size);
if (thread_size == 0) if (thread_size == 0)
break; break;
......
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