Removal of Caches is done too often, particularly after change in camera view
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Load a (fairly large) dataset with timesteps. The sample can.ex2 dataset shows this behavior, but it is really not large enough to really see the problem well. Set the cache size large enough to contain all the geometry for all the timesteps. Turn on the time looping to allow the play through the timesteps to run continuously. Turn on play.
With the system in play mode, the behavior is as follows. The first time through the time sequence, each timestep takes quite a while to load. However, the second (and subsequent) times through the data the run is much faster, as the geometry is cached. You can freely manipulate the camera with the mouse, and the higher speed playback (using the cache) continues. Thus you have the interactive experience of manipulating the running animation.
However, if you stop playback and then change the camera view and then advance time by a timestep or two (manually using the single timestep buttons), and change the timestep again manually the cache gets removed.
If you start out not messing with the continual play and just use the manual forward and backward timestep buttons you will see the following behavior. If you do not change the viewpoint, the caching works as expected. You manually step through timesteps and the first time you hit a timestep it takes a long time to load, but the next time you change to that timestep it is almost immediate. However, if you alter the camera the cache gets removed and you have to wait again for each timestep to load. Sometimes it seems as if a single other timestep remains in the cache, but it is always the case that if you have manually stepped through a number of timesteps (more than one), after you change the viewpoint all of them (except one in some cases) are dumped.
The behavior we see while the play is running is the correct behavior. Changing the viewpoint should not cause the cache to be removed.
I ran into this issue because I am working with ParaView Web, and there is no 'play' capability in ParaView Web, pretty much just the single stepping capability.
As a hacky way to get around this issue, I altered vtkPVCacheKeeper to let me have a flag to disable the removal of caches, and altered vtkPVCacheKeeper::RemoveAllCaches() to pay attention to said flag. However I was not able yet to determine why camera manipulation causes RemoveAllCaches to be called or why it is not called during camera manipulation while continual play is running (Ken Moreland mentioned that it might be due to the fact that during continual play the playback system captures the event loop and runs the event loop differently than while continual play is not running)
Additionally, Alan Scott has told me that the caching is almost always counterproductive on supercomputer back ends, as memory-per-node is generally an issue and the caching can cause problems where things might work initially but the caching causes the memory footprint to be too large after it starts getting used. We may need to consider how caching is defaulted in the system as well as fixing the problem described in this bug.