<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 9:14 PM, Yunlong Liu <span dir="ltr">&lt;<a href="mailto:yliu120@jh.edu" target="_blank">yliu120@jh.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to write my own analysis code using Gromacs API.<br>
I made my own analysis module which inherits AbstractAnalysisData and AbstractDataModuleSerial interface. I want to call tryGetDataFrame( index ) to assess data store in the my AnalysisDataStorage object in the function of dataFinished(). Though I tried many ways, I still get an invalid header.<br>
<br>
I called storage_.finishFrame() in finishedFrame function so that this should be a problem. I am curious about why the storage object doesn&#39;t provide an easier way to access the data like getData( index ).</blockquote><div><br></div><div>Just naming the function differently does not help; there is already a getDataFrame() in AbstractAnalysisData, but it would probably not do what you expect. ;) If you would expect to have such a function that would be able to unconditionally return all the data, never failing, that would mean that the storage object would need to unconditionally store all the data that you produce. That can come at a very high memory cost (depending on the amount of data that your tool produces, and on the length of your trajectory). So the storage object only stores previous frames if someone explicitly requests it do so, by calling requestStorage().</div><div><br></div><div>If you really need to access all the data, you can call requestStorage(-1) on the storage object before adding any data, and then you can access all the data using tryGetDataFrame(). But you should be aware that this increases memory consumption significantly.</div><div><br></div><div>None of the Gromacs tools that have been so far converted (either merged, or those still waiting for review at <a href="http://gerrit.gromacs.org">gerrit.gromacs.org</a>) to use the framework actually require such storage, so it is quite a reasonable design to not store all that data unnecessary. And some, like &#39;gmx rdf&#39;, produce massive amounts of intermediate data that would not really make sense to store.</div><div><br></div><div>Hope this helps,</div><div>Teemu</div></div></div></div>