gmx_spatial pbc error - Redmine #2157
Archive from user: Alexey Anikeenko
When used with -pbc option gmx spatial always produces fatal error:
% gmx spatial -f -s -pbc
...
-------------------------------------------------------
Program: gmx spatial, version 2016.3
Source file: src/gromacs/pbcutil/rmpbc.cpp (line 100)
Fatal error:
Structure or trajectory file has more atoms (2319) than the topology (1)
Problem is that the return value of read_first_frame() function is
used later for rmpbc initialization,
but it does not actually return number of atoms.
Possible fix:
--- gmxana.orig/gmx_spatial.cpp 2016-07-09 07:55:38.000000000 +0700
+++ gmxana/gmx_spatial.cpp 2017-04-14 20:07:37.988999350 +0700
@@ -181,7 +181,8 @@
get_index(atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &nidxp, &indexp, &grpnmp);
/* The first time we read data is a little special */
- natoms = read_first_frame(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &fr, flags);
+ read_first_frame(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &fr, flags);
+ natoms = fr.natoms;
/* Memory Allocation */
MINBIN[XX] = MAXBIN[XX] = fr.x[0][XX];
(from redmine: issue id 2157, created on 2017-04-14 by gmxdefault, closed on 2017-12-14)
- Changesets:
- Revision a464aad0 by Erik Lindahl on 2017-12-14T08:27:42Z:
Fix PBC error in gmx_spatial
Fix provided by Alexey Anikeenko.
Fixes #2157.
Change-Id: I2ac8a4ffac5acb0f3e432036ded3b380d720a719
- Revision c67aef95 by Mark Abraham on 2017-12-14T12:11:01Z:
Fix return values of frame-reading functions
This function was based on read_first_x that returned the number of
atoms, and was documented to do the same, but has always returned a
logical boolean about whether a frame has been read. This led to
aspects of gmx spatial and gmx trjcat -demux being broken.
Fixed by returning a proper bool, and fixing the remaining logic that
used the return value in a non-boolean sense.
Refs #2157
Change-Id: Ic871b56f68c7dbc654ab11b34ff82932353e6ceb
- Uploads: