From: Axel Kohlmeyer (
Date: Sat Apr 18 2009 - 10:11:47 CDT

On Sat, 2009-04-18 at 11:18 +0200, Olaf Lenz wrote:
> Hi!
> Dan Lussier wrote:
> > In trying this series of commands I don't get very far though as the pbc
> > join ... command causes VMD to crash (terminate called after throwing an
> > instance of 'std::bad_alloc' what(): St9bad_alloc).
> This must be a bug somewhere in VMD as it is an error message of C++,
> and not of Tcl. Probably the system is very big and this is a simple
> "Out-of-memory" message? This might in fact be caused by the -ref
> argument that you used, as the "chain" might easily contain all water
> molecules. So just test not using the ref argument.


i'd like to support olaf's suggestions. pbc join has to be used with
great care, its memory use explodes with large systems depending on
the choice of flags. i have run into some problems because of that
myself. you may want to follow the sequence of commands with:
pbc wrap -compound res
to get something that will more closer resemble your initial choice
of commands, particularly for long trajectories.

it would be great if you could upload a set of files/script that
generates the bad_alloc exception to the VMD public biocore BioFS,
so that we can look into reproducing the bug with the latest
development code. thanks.


> Otherwise, to be able to debug, it would help if you could send me the
> DCD and PSF file (please do not send it to the list, but to me personally).
> Also, try to use "pbc join res -verbose" which will output some more
> information which might make it easier to find the problematic piece of
> code.
> > At this point I'm not sure where the problem lies because I'm not sure
> > that my instructions to the pbc join command are ok as I wasn't sure how
> > to interpret the instructions for identifying the 'compound' in the pbc
> > join command.
> I think that your instructions should be OK. The compound argument
> denotes, what compounds join will try to join. For example, when you
> simulate a protein, it might be interesting to all atoms of the
> residues, or the whole chains, depending on what you look at. In your
> case, you can use "fragment", which will join all atoms that are somehow
> bonded, but using "res" might be faster - if the water molecules are in
> fact different residues.
> Olaf

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.