[gmx-developers] New analysis framework: trying to code a new tool

Teemu Murtola teemu.murtola at gmail.com
Fri Mar 29 06:19:57 CET 2013


You don't need to do any of this manually. You can use
AnalysisDataPlotModule to create the output, which will write the
output on-the-fly, without extra memory requirements. Similarly, you can
compute the average and std.dev. using an AnalysisDataAverage module
without coding any of that explicitly. Both of these also make them work with
the future plans for parallelization without any changes. Can't say much
more without seeing the rest of the code, but hopefully this helps.

Best regards,

torstai, 28. maaliskuuta 2013 David van der Spoel kirjoitti:

> Hi,
> I'm working my way through the documentation trying to find out some stuff
> needed to finish my new analysis tool, to compute the free volume in a box.
> Most of it works, but when trying to get a time series I am apparently
> missing something.
> My final writing routine looks like:
> Freevolume::writeOutput()
> {
>     AnalysisDataFrameRef ref;
>     FILE   *fp;
>     int    i;
>     double faver  = fractot_/nframes_;
>     double fsigma = sqrt(frac2tot_/nframes_-faver***faver);
>     printf("Free volume %.2f +/- %.2f %%\n",100*faver,100*fsigma);
>     printf("Number of frames %d\n",data_.frameCount());
>     fp = fopen("koko.xvg","w");
>     for(i=0; (i<data_.frameCount()); i++)
>     {
>         ref = data_.getDataFrame(i);
>         fprintf(fp,"%g  %g\n",ref.x(),ref.y(0));
>     }
>     fclose(fp);
> }
> however, despite frameCount() yielding 101 frames, getDataFrame() fails
> with an API error. I suspect that either I have selected the wrong data
> type for storing the numbers (**AnalysisDataFrameAverageModule**) or I
> have to call a routine to actually get storage for frames (bool
> gmx::AbstractAnalysisData::**requestStorage)
> Any clues?
> --
> David van der Spoel, Ph.D., Professor of Biology
> Dept. of Cell & Molec. Biol., Uppsala University.
> Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205.
> spoel at xray.bmc.uu.se    http://folding.bmc.uu.se
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/**mailman/listinfo/gmx-**developers<http://lists.gromacs.org/mailman/listinfo/gmx-developers>
> Please don't post (un)subscribe requests to the list. Use the www
> interface or send it to gmx-developers-request at gromacs.org.

Teemu Murtola
<teemu.murtola at iki.fi>
+358 50 362 6829
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130329/84c26f07/attachment.html>

More information about the gromacs.org_gmx-developers mailing list