[gmx-developers] table allocations

Graham Smith smithgr at cancer.org.uk
Fri Jun 14 22:50:30 CEST 2002


Isn't quite a lot of space currently wasted when fr->coultab and
fr->vdwtab are snew'ed in mdlib/force.c? 
  snew(fr->coultab,4*(fr->ntab+1)*sizeof(real));
  snew(fr->vdwtab,(tabelemsize-4)*(fr->ntab+1)*sizeof(real));  

I think (fr->ntab+1)*sizeof(real) needs only to be (fr->ntab+1)+1, 
as is is when fr->coulvdwtab is allocated in tables.c 
  snew(fr->coulvdwtab,12*(nx+1)+1);

I presume the tables.c code is never called to tabulate a buckingham 
potential, only for user-defined potentials, so there is no
danger you'd ever need 16 not 12? 

Cheers 

-Graham 

########################################################################

Dr. Graham R. Smith, 		       Department of Biological Sciences,  
Biomolecular Modelling Laboratory,     Biochemistry Building,              	
Cancer Research UK, 		       Imperial College of Science,        	
44 Lincoln's Inn Fields, 	        Technology & Medicine,             	
London WC2A 3PX,		       London SW7 2AZ,                     	
U.K. 				       U.K.                                	
Tel: +44-(0)20 7269 3348 	       Tel: +44-(0)20 7594 5737            	
email: graham.smith at cancer.org.uk	
URL: http://www.bmm.icnet.uk/~smithgr





More information about the gromacs.org_gmx-developers mailing list