Open maedoc opened 8 years ago
waits for a status flag from output
Yes
s sd_out -> apply() do? It hasn't been implemented yet.
It is implemented by each of the outputs, see for example file output here
Isn't it necessary for apply() function to run on the same thread as the solver? Since it outputs the current state. But apply() is definitely part of the output handler..
Output handling requires lightweight calculation, I/O and memory access that's entirely independent of the integration, so it should be fairly easy to move this work to a separate thread, as the solver pushes new data to root output at every time step. The solver current waits for a status flag from the root output, but since future result doesn't affect past, if the output returns a failure asynchronously, the solver can stop and no harm done.
This would require additionally mutexing the malloc routines, as they are used in the
sd_out_mem
implementation.TinyCThread may be useful for avoiding platform specific code.