[gmx-developers] Analysis API - AbstractDataStorage - tryGetDataFrame() not working
yliu120 at jh.edu
Fri Nov 21 17:13:01 CET 2014
By your comment:
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.
What I understand is that the DataStorage object doesn't store any data
I produced with my tool, correct? So when it pass through a frame, it
only deals with the data produced by that frame and then it will pass
the results to the plot or histogram module or to a file, is this correct?
So in this case, if I am trying to do such an analysis, which will use
data produced by all the frames together. The analysis module can't
help, is that correct?
Thank you for your reply.
On 11/20/14 11:58 PM, Teemu Murtola wrote:
> On Thu, Nov 20, 2014 at 9:14 PM, Yunlong Liu <yliu120 at jh.edu
> <mailto:yliu120 at jh.edu>> wrote:
> I am trying to write my own analysis code using Gromacs API.
> 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.
> I called storage_.finishFrame() in finishedFrame function so that
> this should be a problem. I am curious about why the storage
> object doesn't provide an easier way to access the data like
> getData( index ).
> 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().
> 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.
> None of the Gromacs tools that have been so far converted (either
> merged, or those still waiting for review at gerrit.gromacs.org
> <http://gerrit.gromacs.org>) 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 'gmx rdf', produce massive amounts of
> intermediate data that would not really make sense to store.
> Hope this helps,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers