Commit 6a6a3f87 authored by Beerwerth, Randolf's avatar Beerwerth, Randolf
Browse files

Merge branch 'performance-parameters' into 'develop'

Remove quadratic scaling with number of layers

See merge request !8
parents 3d139e8e f4605968
Pipeline #33299 passed with stage
in 19 minutes and 28 seconds
......@@ -22,8 +22,6 @@
#include "Sample/Multilayer/MultiLayerUtils.h"
#include "Sample/SampleBuilderEngine/ISampleBuilder.h"
#include <gsl/gsl_errno.h>
#include <iomanip>
#include <iostream>
#include <thread>
namespace {
......@@ -211,12 +209,16 @@ void ISimulation::runSimulation()
if (batch_size == 0)
return;
std::unique_ptr<ParameterPool> param_pool(createParameterTree());
for (size_t index = 0; index < param_combinations; ++index) {
double weight = m_distribution_handler.setParameterValues(param_pool.get(), index);
runSingleSimulation(batch_start, batch_size, weight);
if(param_combinations == 1)
runSingleSimulation(batch_start, batch_size, 1.);
else{
std::unique_ptr<ParameterPool> param_pool(createParameterTree());
for (size_t index = 0; index < param_combinations; ++index) {
double weight = m_distribution_handler.setParameterValues(param_pool.get(), index);
runSingleSimulation(batch_start, batch_size, weight);
}
m_distribution_handler.setParameterToMeans(param_pool.get());
}
m_distribution_handler.setParameterToMeans(param_pool.get());
moveDataFromCache();
transferResultsToIntensityMap();
}
......
......@@ -12,6 +12,7 @@
//
// ************************************************************************************************
#include "Base/Utils/Assert.h"
#include "Sample/Multilayer/MultiLayer.h"
#include "Param/Base/ParameterPool.h"
#include "Param/Base/RealParameter.h"
......@@ -145,8 +146,10 @@ void MultiLayer::addAndRegisterInterface(LayerInterface* child)
void MultiLayer::handleLayerThicknessRegistration()
{
size_t n_layers = numberOfLayers();
for (size_t i = 0; i < numberOfLayers(); ++i)
m_layers[i]->registerThickness(i > 0 && i < n_layers - 1);
ASSERT(n_layers > 0);
m_layers[n_layers-1]->registerThickness(false);
if(n_layers > 2)
m_layers[n_layers-2]->registerThickness();
}
size_t MultiLayer::check_layer_index(size_t i_layer) const
......
Supports Markdown
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