Previous Thread
Next Thread
Print Thread
#12390 11/14/06 02:08 PM
Joined: Nov 2006
Posts: 3
K
krivov Offline OP
Forum Member
OP Offline
Forum Member
K
Joined: Nov 2006
Posts: 3
Hi,
i am having a problem extending charmm code. my code performs rmsd clustering and uses extensivly ROTLS1 subroutine. in charmm c30a2 everything was fine. in c33a2 and c33b1 the code hangs at some point. if i restart the job, the code hangs exactly at the same point. if i change a source slightly, the code hangs also but at a different point. seems like a memory leak or initialization problem. the write(*,*) statements showed that the bug is not in my part of the code.

To catch the bug, i decided to recompile charmm with array boundary checking flag "-ffortran-bounds-check". when i started it, it showed a lot of places with invalid indexes. Did anybody ever checked this or am i doing something wrong?

Joined: Sep 2003
Posts: 8,659
Likes: 26
rmv Online Content
Forum Member
Online Content
Forum Member
Joined: Sep 2003
Posts: 8,659
Likes: 26
Because of the CHARMM memory management scheme using the HEAP data structure, it is not possible to apply bounds checking to all Fortran files; those with references to the HEAP array must be excluded.


Rick Venable
computational chemist

Joined: Nov 2006
Posts: 3
K
krivov Offline OP
Forum Member
OP Offline
Forum Member
K
Joined: Nov 2006
Posts: 3
could be but for example: subroutine corcom in corman.src in the begining gives

write(*,*) islct,jslct,rwork ! my modification
stop !

CALL CORMAN('MAIN', X, Y, Z, WMAIN, XCOMP, YCOMP, ZCOMP,
& WCOMP, NATIML, HEAP(ISLCT), HEAP(JSLCT), TYPE,
& RESID, RES, IBASE, SEGID, NICTOT, NSGIML, AMASS,
& CG, NTRANS, IMNAME, IMTRNS, XUCELL,
& HEAP(RWORK))


-31415927 -31415927 -31415927

is it correct? can heap use negative indexes? or it is just printed wrong due to the different integer kind?
thanks.

Joined: Sep 2003
Posts: 8,659
Likes: 26
rmv Online Content
Forum Member
Online Content
Forum Member
Joined: Sep 2003
Posts: 8,659
Likes: 26
Because CHARMM uses malloc() to acquire more memory from the OS, the indices into the HEAP can be outside the initial dimensioned size of the HEAP array, and could be negative depending on the memory mapping scheme of the OS. That's exactly why you cannot use array bounds checking on any routine that contains indices into the HEAP.


Rick Venable
computational chemist

Joined: Nov 2006
Posts: 3
K
krivov Offline OP
Forum Member
OP Offline
Forum Member
K
Joined: Nov 2006
Posts: 3
OK, thanks a lot for the answer.

Joined: Sep 2003
Posts: 395
Forum Member
Offline
Forum Member
Joined: Sep 2003
Posts: 395
Your problem is probably in the diagonalization routine, DIAGQ.

Check the precision variables and the level of optimization. If these are not correct, the sturm bisection iterative code may never converge.

Joined: Sep 2003
Posts: 175
Forum Member
Offline
Forum Member
Joined: Sep 2003
Posts: 175
You can certainly use the program which check memory problems. It is called valgrind from www.valgrind.org. To run this you do not need to recompile CHARMM, it works with the executable!


Moderated by  BRBrooks, bucknerj, lennart, rmv 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Release build 20201027)
Responsive Width:

PHP: 7.3.31-1~deb10u5 Page Time: 0.014s Queries: 28 (0.010s) Memory: 0.7568 MB (Peak: 0.8186 MB) Data Comp: Off Server Time: 2023-11-28 20:36:22 UTC
Valid HTML 5 and Valid CSS