From: Timothy Leong (
Date: Wed Jan 20 2021 - 12:23:53 CST

Greetings all,

I recently had a crash that returned no error message when assigning LJ
Parameters to a CG system with ~52000 atoms in the all-atom model on a
Linux OS with 6 GB of RAM (VMD version 1.9.3). After looking into the
cgtools.tcl package I noticed that lines 834-841 were responsible for the
memory overflow issue, given that they involve the creation of numerous
atomselections that accumulate without deletion. After commenting out that
section and using the following as a replacement:

set beta_list [[atomselect $pdbrefID all] get beta]
set NCG 0
# jdex is for debugging purposes
# set jdex -1
foreach {beta_val} $beta_list {
# incr jdex
if {$beta_val > $NCG} {
set NCG $beta_val
# puts $jdex
unset beta_list
# There should not be any adverse effects from leaving the integer
# until the very end. The benefit of this is decreased computational load.
set NCG [expr int($NCG)]

..the LJ parameter assignment works without crashing VMD. However, I want
to know if it is possible to implement this change without 'hard-coding'
the original cgtools.tcl package.

The reason for this is because my patch is going to be included as part of
my Principal Investigator's upcoming research paper, and that cgtools.tcl
is the copyright of Axel Kohlmeyer. As a result, I obviously would not like
to have to copy the rest of the ::cgtools::sasa_LJ_networking procedure if
I can avoid it.

Timothy Leong