-
Notifications
You must be signed in to change notification settings - Fork 3
Description
We compute the time-steps sequentially right now for each MTG node. It could be interesting to be able to add a parallel computation over it in addition to the parallel computation over nodes.
To do so, we have to change the way we compute the time steps. For now, we make a Status with one time-step, and we initialise it with the time-step, then run the simulation, then take the value to the attributes, and we do that for each time-step. This involves a lot of unnecessary copies, and is not parallelizable.
We have to find a better, more efficient and parallelizable way of doing that.
One proposition is to make a structure like the Status that would be a pointer to the values in the attributes. Users should initialize the attributes properly though, the length of each argument being of length of time-steps.
Another way would be to initialise the status properly with all time-steps, and keep the values there. And to avoid copies of the same values, the attributes in the node could be references to the values in the status. The benefit here is to use the status as it was intended, so we could use all methods from PlantSimEngine without any modifications. The inconvenient is that we have to find a good way to reference the values inside the status without changing the code elsewhere, and make it appear as it was just normal values.
One way or another, we need to define a structure to point to other values.