Commit 6021a4eb authored by Tobias Weber's avatar Tobias Weber

adapted to tlibs changes

parent e30f47ee
......@@ -13,7 +13,7 @@ CC = g++
#CC = clang++
# debug or unstable version?
DO_DEBUG = 1
DO_DEBUG = 0
IS_UNSTABLE = 0
# optimise specifically for THIS processor?
......
......@@ -173,6 +173,8 @@ int main(int argc, char** argv)
}
// --------------------------------------------------------------------
tl::Stopwatch<t_real> watch;
watch.start();
unsigned int iNumThreads = get_max_threads();
tl::ThreadPool<bool()> tp(iNumThreads);
......@@ -190,11 +192,7 @@ int main(int argc, char** argv)
});
}
tl::Stopwatch<t_real> watch;
watch.start();
tp.StartTasks();
auto& lstFut = tp.GetFutures();
auto& lstFut = tp.GetResults();
std::size_t iTask = 0;
for(auto& fut : lstFut)
{
......
......@@ -260,7 +260,7 @@ void ConvoDlg::Start1D()
void (*pThStartFunc)() = []{ tl::init_rand(); };
tl::ThreadPool<std::pair<bool, t_real>()> tp(iNumThreads, pThStartFunc);
auto& lstFuts = tp.GetFutures();
auto& lstFuts = tp.GetResults();
for(unsigned int iStep=0; iStep<iNumSteps; ++iStep)
{
......@@ -332,8 +332,6 @@ void ConvoDlg::Start1D()
});
}
tp.StartTasks();
auto iterTask = tp.GetTasks().begin();
unsigned int iStep = 0;
for(auto &fut : lstFuts)
......@@ -758,7 +756,7 @@ void ConvoDlg::Start2D()
void (*pThStartFunc)() = []{ tl::init_rand(); };
tl::ThreadPool<std::pair<bool, t_real>()> tp(iNumThreads, pThStartFunc);
auto& lstFuts = tp.GetFutures();
auto& lstFuts = tp.GetResults();
for(unsigned int iStep=0; iStep<iNumSteps*iNumSteps; ++iStep)
{
......@@ -830,8 +828,6 @@ void ConvoDlg::Start2D()
});
}
tp.StartTasks();
auto iterTask = tp.GetTasks().begin();
unsigned int iStep = 0;
for(auto &fut : lstFuts)
......@@ -1032,7 +1028,7 @@ void ConvoDlg::StartDisp()
tl::ThreadPool<std::tuple<bool, std::vector<t_real>, std::vector<t_real>>()>
tp(iNumThreads);
auto& lstFuts = tp.GetFutures();
auto& lstFuts = tp.GetResults();
for(unsigned int iStep=0; iStep<iNumSteps; ++iStep)
{
......@@ -1053,8 +1049,6 @@ void ConvoDlg::StartDisp()
});
}
tp.StartTasks();
auto iterTask = tp.GetTasks().begin();
unsigned int iStep = 0;
for(auto &fut : lstFuts)
......
......@@ -528,9 +528,7 @@ Ellipsoid4d<t_real> TASReso::GenerateMC(std::size_t iNum, std::vector<t_vec>& ve
{ mc_neutrons<t_vec>(ell4d, iNumNeutr, this->m_opts, iterBegin); });
}
tp.StartTasks();
auto& lstFut = tp.GetFutures();
auto& lstFut = tp.GetResults();
for(auto& fut : lstFut)
fut.get();
......
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