
Hi Bill,
On 05/15/2018 04:17 AM, Bill Sze wrote:
Hi,
When I ran the time_poisson_interactive [1] example, I noticed that probing took a lot of time. Speciffically, when I:
- used pb.get_tss_functions(state0, save_results=False) to turn off saving to disk,
- commented out any matplotlib plotting part, and
- turned on options.probe
- ran 201 time steps
... the problem was solved in 46.9 seconds (the tss() call at the bottom), but probing itself (only the entire for loop for the two probes from "for ii, probe in enumerate(probes):" to "append(results)") took 27.1 seconds in total (0.135 sec each step on average).
Further profiling reveals that everytime when Field.evalute_at() is called during probing, the get_ref_coors() function and its subsequent downstream functions are called to (what I understand) find the evalutaion points in the mesh, taking up 26.4 seconds in total.
This is rather inefficient. Is there a way to reuse the previously calculated probing cells, since the probes and mesh are constant throughout the problem?
Good observation, thanks!
It is possible to cache the reference coordinates, but it is up to the caller, and the probes have not used that feature.
I have just updated the probes (work in progress) to reuse the reference coordinates, if possible - could you check the updated code in [2] and report back here if the update improves your results?
r.
[2] https://github.com/rc/sfepy/tree/cache-refcoors-in-probes
[1] http://sfepy.org/doc-devel/examples/diffusion/time_poisson_interactive.html