Topic Options
#29178 - 01/29/12 12:46 PM c36b1 atom deletion / re-reading gives error
Wonmuk Hwang Offline
Forum Member

Registered: 03/27/11
Posts: 8
Loc: Texas, USA
Dear all,

I encountered a strange freezing behavior of the script when using c36b1 for neutralizing a solvated system. After some efforts, I was able to reproduce the error using the following short script:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* test.inp
*
prnlev 10

set 0 "/usr/local/charmm/c36b10/test/data/"
set 1 "/usr/local/charmm/c36b10/toppar/"

! Read the RTF and parameter files
OPEN READ UNIT 11 CARD NAME @1top_all27_prot_na.rtf
READ RTF UNIT 11 CARD
CLOSE UNIT 11
OPEN READ UNIT 12 CARD NAME @1par_all27_prot_na.prm
READ PARAMETERS UNIT 12 CARD
CLOSE UNIT 12

set L 18.856 ! size of unit water box
set nwat 216 ! number of water in unit box

! Read unit water box
read sequ tip3 @{nwat}
generate w0 setup noangle nodihe
open unit 1 read form name @0tip@{nwat}.crd
read coor card unit 1 append
close unit 1

write psf card name temp.psf
write coor card name temp.cor

! If any one of the next three lines is commented, the script runs normally
delete atom sele resi 100 end sort ! Line 1; the actual resid doesn't matter
delete atom sele resi 125 end sort ! Line 2
cons fix sele none end ! Line 3

! If this block is commented out, the script runs normally
read psf card name temp.psf ! Line 4a
read coor resi card name temp.cor ! Line 4b

! If the next line is commented out, the script runs normally
delete atom sele resi 58 end sort ! Line 5

coor stat
stop
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

As indicated in the comments above, if any of Lines 1-5 is commented out, the program runs fine. It seems like a malloc bug in c36b1:

1. The script runs fine when I use c36a6 (it is thus unlikely a compiler bug).
2. With c36b1 built using gnu compiler (single cpu), I get segmentation fault.
3. With c36b1 built using ifort (single cpu), I get a long error that starts with:

*** glibc detected *** charmm: double free or corruption (out): 0x0000000005eb96b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x78a96)[0x7f7570910a96]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f7570914d7c]
charmm(for_dealloc_allocatable+0xfc)[0x15410ec]
charmm(deallocation_mp_dealloc_1d_+0x2ba)[0x14051da]
charmm(deltic_+0xe40)[0x86c360]
charmm(maincomx_+0x720)[0x488140]
charmm(MAIN__+0x1894)[0x4879f4]
charmm(main+0x3c)[0x48614c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f75708b930d]
charmm[0x486049]
======= Memory map: ========
00400000-017f7000 r-xp 00000000 08:02 2637481 /usr/local/charmm/c36b10/exec/gnu_M/charmm
.....(error continues)

4. The same problem occurs when using c36b1 compiled with openmpi.
5. Strangely, if I replace line 3 with another dele atom command, the script runs fine.


For compilation of c36b1, I just used basic options, like: ./install.com gnu medium [ifort] [M] (error occurs w/o the last two options)

Here are additional info:
1. System: Linux yogi 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 17:23:00 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
2. Versions: gcc-4.6.1, ifort-12.1.0

If not a bug, I am wondering whether I'm doing something wrong in the script above (the script is to reproduce the error, not to accomplish something, so it has non-useful lines like cons fix sele none end).

Thanks,

Wonmuk Hwang

Top
#29192 - 01/30/12 05:55 PM Re: c36b1 atom deletion / re-reading gives error [Re: Wonmuk Hwang]
mgarraha Offline
Forum Member

Registered: 05/13/09
Posts: 125
Definitely a bug. Thanks for the script; I get similar results when I run it. You're welcome to register at http://www.charmm.org/redmine to track progress of the fix.

Top

Moderator:  BRBrooks, bucknerj, chmgr, John Legato