The script charmm_gen.com was designed at NIH for easy maintenance of multiple executables in an active research environment. Multiple versions versions can be derived from the same source code, incorporating different features and maximum atom limits. It is assumed that install.com has already been run, and any porting or compiling issues resolved before charmm_gen.com is used. In fact, charmm_gen.com simply calls install.com after doing a little creative copying and renaming. The script is interactive; it asks a few questions, does a lot of checking, and then proceeds to make up to nine different versions in one operation with no further human intervention required. A "test" or development version can also be prepared, and is in fact the "path of least resistance", i.e. the accepting of all the defaults to each prompt. Since simply starting up a LARGE version of CHARMM with most of the available feature sets can easily require over 100 Mbyte of memory, we recognized the need to have multiple executables available. Our choice was to create 2 principal versions: "full", with most major modules included and GAMESS used as the QM/MM combination; and "lite", without many of the high memory usage or rarely used modules, but with the X11 graphics and the QUANTUM QM/MM code. Each is available in 3 sizes, small, medium, and large. We also use a "cover" script in /usr/local/bin to run CHARMM, after parsing feature set and size keywords, and stripping them from the command line. An example is included at the end of this description. Currently, seven different sets of object libraries are maintained as well; this does require a bit of disk space, but allows rapid re-building of all versions when bugfixes are made.
To use charmm_gen.com, the following additional files are *required* in build/mach, where mach = hpux in this case: Makefile_hpux.full Makefile_hpux.lite Makefile_hpux.test Makefile_hpux.test.list pref.large pref.medium pref.small pref.full pref.lite pref.dat.test Makefile_hpux.full defines additional tools, directories, and libraries needed to compile the SHAPES code and the GAMESS code for QM/MM calculations, while the .lite version is a typical generic version of Makefile_hpux. Makefile_hpux.test is configured for rapid re-compiling of CHARMM during development, while Makefile_hpux.test.list produces cross-referenced source listings by changing the definition of the variable FC at the top of the makefile. The remaining files represent the pref.dat info used to create the different possible versions; they are combined via 'cat' to dynamically create the pref.dat file at compile time. The exception is pref.dat.test, which is simply copied to pref.dat. At NIH, the keywords in pref.dat.test are usually the same as the catenation of pref.medium and pref.full, but that doesn't have to be the case. The following listing shows the pref.dat keywords we chose for the 2 different feature sets at NIH: Example pref.medium; pref.large and pref.small are the same except for the respective size keywords. HPUX ! machine type UNIX PARALLEL ! multiple processors/workstations PARAFULL ! req'd for parallel SYNCHRON ! req'd for parallel SOCKET ! req'd for parallel CMPI GENCOMM MEDIUM ! size directive = 25120 atom limit SCALAR ! machine characteristics = default for scalar machines VECTOR ! feature directive * = Vectorized routines PARVECT ! Parallel vector code (multi processor vector machines) CRAYVEC ! Fast vector code (standard vector code) SAVEFCM ! Include all SAVE statements PUTFCM FCMDIR=fcm LONGLINE ! Allows a longer line output format (>80 characters). Example pref.lite; at NIH we include the X11 graphics here, so that foreground graphics usage is less memory intensive overall. ASPENER ! feature directive * = Atomic Solvation Parameter energy term NIH ! feature directive * = NIH default specs code PERT ! feature directive * = NIH free energy code MMFF ! feature directive = Merck Molecular Force Field QUANTUM ! feature directive * = AM1 semi-empirical QM interface REPLICA ! feature directive = Replica code NOST2 XDISPLAY END ! end Example pref.full; GAMESS + most of the optional feature keywords ASPENER ! feature directive * = Atomic Solvation Parameter energy term BLOCK ! feature directive * = Energy partition and free energy code MOLVIB ! feature directive = MOLVIB vibrational analysis code MTS ! feature directive = Multiple time step code NIH ! feature directive * = NIH default specs code OLDDYN ! feature directive = Old dynamics integrator PERT ! feature directive * = NIH free energy code GAMESS ! GAMESS ab initio interface for QM/MM PBEQ ! Poisson Boltzmann POLAR ! Polarizable water model PULL MMFF ! Merck Molecular Force Field REPLICA ! feature directive = Replica code RISM ! feature directive = RISM solvation code RXNCOR ! feature directive * = RXNCOR code TNPACK ! Truncated Newton TRAVEL ! feature directive * = PATH and TRAVEL code TSM ! feature directive = TSM and ICPERT code DIMB ! feature directive FMA ! feature directive FOURD ! feature directive PRIMSH ! feature directive PBOUND ! simple Periodic BOUNDary (min image) ZTBL ! feature directive PM1 PATHINT MCSS SHAPES ! feature directive = SHAPE descriptor code END
Finally, to make life easy for the end users, we use the following
script to run CHARMM on a routine basis:
#! /bin/csh
# INITIALIZE VARIABLES
if ( -e /v/par18a/charmm ) then
set chmroot = /v/par18a/charmm
else if ( -e /v/par8/users/charmm ) then
set chmroot = /v/par8/users/charmm
else
echo 'Filesystem problems; can't find CHARMM executables'
exit(1)
endif
set n = $#argv
setenv HOST `hostname | cut -f1 -d.`
set chmsiz = small
set i = 1
set chrmvrsn = c24n6
set chmopt = lite
set chmmode = any
# CHECK FOR OPTIONAL KEYWORDS
while ( $i <= $n )
switch ( $argv[$i] )
case small:
set chmsiz = small
breaksw
case large:
set chmsiz = large
breaksw
case medium:
set chmsiz = medium
breaksw
case test:
set chmopt = test
breaksw
case lite:
set chmopt = lite
breaksw
case am1:
set chmopt = lite
breaksw
case full:
set chmopt = full
breaksw
case c26n1:
set chrmvrsn = c26n1
breaksw
case c26a1:
set chrmvrsn = c26a1
set chmopt = test
breaksw
case c25b1:
set chrmvrsn = c25b1
set chmopt = test
breaksw
case c25n3:
set chrmvrsn = c25n3
breaksw
case c25a3:
set chrmvrsn = c25a3
breaksw
case c24n6:
set chrmvrsn = c24n6
breaksw
case c24b1:
set chrmvrsn = c24b1
breaksw
endsw
@ i = $i + 1
end
# STRIP VALID KEYWORDS FROM ARGUMENT STRING; OTHERWISE, CHARMM WILL PARSE THEM
set t = `echo $* | sed -e 's/small//' -e 's/medium//' -e 's/test//' -e 's/full//' -e 's/large//' -e 's/lite//' -e 's/c24b1//' -e 's/c24n6//' -e 's/c25n3//' -e 's/c25a3//' -e 's/c25b0//' -e 's/c25b1//' -e 's/c26a1//' -e 's/c26n1//'`
# ECHO WORKING DIRECTORY
if ( $?PWD ) then
echo $PWD
else
echo $cwd
echo "Warning: env var PWD not defined; required for parallel CHARMM"
endif
# VERIFY THE ACTUAL EXECUTABLE; RUN AT REDUCED PRIORITY
if ( $chmopt == test ) then
set exe = $chmopt
else
set exe = $chmsiz.$chmopt
endif
# CHARMM VERSION W. TIMESTAMP; PASS EXIT STATUS CODE
ls -o $chmroot/$chrmvrsn/exec/hpux/charmm.$exe
if { /bin/nice -5 $chmroot/$chrmvrsn/exec/hpux/charmm.$exe $t } then
exit(0)
else
echo '(charmm) ABNORMAL EXIT'
exit(1)
endif
NIH/NHLBI/LBC Computational Biophysics Section
FDA/CBER/OVRR Laboratory of Biophysics