Closed lmoffatt closed 9 months ago
Time_it_st is the single threaded implementation of Time_it. commit 9bd47dd
Now we should see how Memoization is used.
Lets see:
var::Thread_Memoizer(
var::F(Calc_Qdt_step{},
[](auto &&...x) {
auto m = Macro_DMR{};
return m.calc_Qdt_ATP_step(std::forward<decltype(x)>(x)...);
}),
var::Memoiza_all_values<Maybe_error<Qdt>, ATP_step, double>{},
num_scouts_per_ensemble / 2),
so, we have two options: Option one we remove the thread function of Thread_Memoizer. Option two we make the Memoiza_all_values to include the function.
I guess the first option is better. So we create Single_Thread_Memoizer 63b5183
Test_it is partially implemented (is right now mostly a copy of Time_it)
Now I implement FuncMapSt
we have to implement several new methods/functions
Now the problem is how to integrate the new functionality into the old code.
Now my problem is that both the new code and the old code uses FuncMaps and I dont know if it is a good idea to have two copies of that.
So, there are two bads:
The solution is simple: make both interfaces or FuncMap and FuncMapSt temporarilty the same in this way we can make the FuncMapSt code to compile and then by removing the temporarily changes we remove FuncMap altogether
The first part is to integrate FuncMapSt into existing code.
I did it d58cf11 and it compiles for main and old_code
Run it, and it gave weird results (waaay too many min violation errors). It turned out that the logic of Memoization clearance was flawed. Solved in commit 678bc74
So: here are the changes