Project

General

Profile

Bug #186

g_clustsize demends to have a tpr file even when it's not needed

Added by Ran Friedman almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Created an attachment (id=273)
corrected version for the CVS (CVS downloaded at 22/01/08)

According to the documentation of g_clustsize, the -s falg is optional, and the user needs to use it only for analysing molecules. However, when trying the run without the -s flag, the following error message is printed:

Can not open file:
topol.tpr

This happends both in GMX 3.3.1 and in the CVS version.

The fix seems to be simple (I tried it only on the CVS version):

diff gmx_clustsize.c gmx_clustsize.c.org
106a107,112

read_tpxheader(tpr,&tpxh,TRUE,&version,&generation);
if (tpxh.natoms != natoms)
gmx_fatal(FARGS,"tpr (%d atoms) and xtc (%d atoms) do not match!",
tpxh.natoms,natoms);
read_tpx(tpr,&sss,&ttt,&lll,NULL,NULL,&natoms,NULL,NULL,NULL,&top);

113,117d118
< read_tpxheader(tpr,&tpxh,TRUE,&version,&generation);
< if (tpxh.natoms != natoms)
< gmx_fatal(FARGS,"tpr (%d atoms) and xtc (%d atoms) do not match!",
< tpxh.natoms,natoms);
< read_tpx(tpr,&sss,&ttt,&lll,NULL,NULL,&natoms,NULL,NULL,NULL,&top);

In other words, in the function clust_size, line 107-111 should be moved to the loop after line 118, which checks if the function deals with molecules.

I add a corrected version.

Cheers,
Ran.

gmx_clustsize.c (12.8 KB) gmx_clustsize.c corrected version for the CVS (CVS downloaded at 22/01/08) Ran Friedman, 01/28/2008 11:19 AM

History

#1 Updated by David van der Spoel over 11 years ago

I have committed a slightly different version. Your version does not take into account that a trr file may be used for the analysis, in which case the top is not initialized. Nevertheless it is useful not to need the tpr file all the time.

Also available in: Atom PDF