[gmx-developers] Getting the last frame in an xtc file

Mark Abraham Mark.Abraham at anu.edu.au
Thu Apr 10 14:07:44 CEST 2008

Ran Friedman wrote:
> Mark Abraham wrote:
>> Roughly speaking, xtc_at_header_start expects to be at the start of a
>> frame to read its header, or to fail. The 3.3.1 version of
>> xtc_get_frame_number does the test-for-header with explicit code,
>> whereas 3.3.3 does it with the call to xtc_at_header_start. When the
>> test fails, and xtc_at_header_start fails, the 3.3.3 version should
>> probably have
>>     if(gmx_fseek(xdrfiles[fp+1],off-sizeof(int)*2,SEEK_SET)){
>> as line 1328, not
>>     if(gmx_fseek(xdrfiles[fp+1],off,SEEK_SET)){
>> so that it seeks backwards in the same way as the 3.3.1 code does. Ran
>> can probably test this to see if it works :-)
> Ran will test it and report back to the list :-)
> I should look for the code in previous versions next time I guess.

Yeah it's tough break, but there's a comment about the code being 
unused, and thus untested and maybe buggy :-) You're lucky I've been 
looking at this code in 3.3.1 for my implementation of the wiki-project 
for generalized multiple-file I/O.


More information about the gromacs.org_gmx-developers mailing list