an introduction to charmm on hpcx - cse.scitech.ac.uk · an introduction to charmm on hpcx ... (ab...

53
Computational Science & Engineering Department CSE Computational Chemistry Group, 2005 An Introduction to CHARMM on HPCx Paul Sherwood CCLRC Daresbury Laboratory [email protected]

Upload: lyxuyen

Post on 18-Jul-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

Computational Science & Engineering DepartmentCSE Computational Chemistry Group, 2005

An Introduction to CHARMM on HPCx

Paul Sherwood

CCLRC Daresbury [email protected]

Page 2: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

2Computational Science &  Engineering Department

Outline

• History• Program Overview 

– Functionality– Forcefield– Data Structures– Scripting

• CHARMM parallel performance• Example script 

– molecular dynamics of a water box• CHARMM and GAMESS­UK

– Standard QM/MM calculations– Replica Path calculations

• Running CHARMM on HPCx 

Page 3: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

3Computational Science &  Engineering Department

History of the CHARMM Program

• CHARMM = Chemistry at Harvard Macromolecular Mechanics–a computer program and a force field

• Development initiated by Martin Karplus and Bernie Brooks at Harvard in the early 1980s

B. R. Brooks, R. E. Bruccoleri, B. D. Olafson, D. J. States, S. Swaminathan, M. Karplus, 'CHARMM: A Program for Macromolecular Energy, Minimization, and Dynamics Calculations', J. Comput. Chem. (1983) 4, 187­217. 

• Many others now contribute:– Bernie Brooks (now at NIH, Bethesda)

– Charlie Brooks (III) (Scripps Research Institute, San Diego)

– Alex MacKerell leads the development of the CHARMM force field

– Milan Hodošček ­ parallelisation

– many more, see links under www.charmm.org

Page 4: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

4Computational Science &  Engineering Department

CHARMM Functionality (i)

• Molecular Mechanics (Energy Minimization) • Molecular Dynamics 

– Classical Simulations – Crystal Simulations – Specialized techniques (Umbrella Sampling, Constant Pressure) 

• Monte Carlo simulation package • Free Energy Perturbation Calculations 

– Block program – Perturb program – Thermodynamic Simulation Method (TSM) 

• Normal Mode and Molecular vibrational analysis facility • Reaction Path Determination 

– replica path, NEB

Page 5: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

5Computational Science &  Engineering Department

CHARMM Functionality (ii)

• Advanced implicit solvent models – Analytical Continuum Electrostatics (ACE) model – Effective Energy Function 1 (EEF1) – Generalized Born Solvation Energy (GBorn) 

• Interfaces – Multi­body dynamics (MBOND) – Merck Molecular Force Field (MMFF) – Quantum and Molecular Mechanical Force Field (QM/MM) 

• Misc – Analysis facility – Time series and correlation function calculations – NMR analysis facility – Poisson­Boltzmann Equation Solver – Reference Interaction Site Model (RISM)

Page 6: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

6Computational Science &  Engineering Department

The CHARMM Force Field

• The energy, E, is a function of the atomic positions, R, of all the atoms in the system, these are usually expressed in term of Cartesian coordinates. 

• The value of the energy is calculated as a sum of internal, or bonded, terms Ebonded, which describe the bonds, angles and bond rotations in a molecule, and a sum of external or nonbonded terms, Enon­bonded, These terms account for interactions between nonbonded atoms or atoms separated by 3 or more covalent bonds.

Page 7: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

7Computational Science &  Engineering Department

Bonded terms

• Improper Torsion (e.g. planarity constraints)

• Bonded Terms:

Page 8: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

8Computational Science &  Engineering Department

Non­bonded Terms

Page 9: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

9Computational Science &  Engineering Department

CHARMM Parallel functionality

• Energy evaluation ENERgy, GETE, SKIPE, ENERgy ACE MINImization (CONJ,NRPH,ABNR,POWEL,TN) 

• DYNAmics (leap frog integrator) HBOND BLOCK CRYSTAL (all) IMAGES INTEraction energy 

• CONStraints (SHAKE,HARM,IC,DIHEdral,FIX,NOE,RESD, LONEPAIR)

• ANAL (energy partition) NBONds (generic) EWALD PME PERT GAMESS (ab initio part) 

• TEST FIRST, SECOND REPLICA • TREK EEF1 IMCUBES (bycb) RCFFT • FSSHK (fast non­vector shake) • GENBORN GBBLOCK GRID• HMCM RCFFT BYCC TSM TMD GRAPE HQBM PSSP ADUMB 

MTS SSBP DRUDE VV2 LONEPAIR 

Page 10: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

10Computational Science &  Engineering Department

Functional but Non­parallel

– VIBRAN **, CORREL **(Except for the energy time series evaluation, which is parallel) READ, WRITE, and PRINT (I/O in general) 

• NOTE: always protect prnlev ... with if ?mynode .eq. 0 then prnlev ... – CORMAN commands COPY, ORIENT, CONVERT, SURFACE, CONTACT, 

VOLUME, LSQP, RGYR HBUIld ** IC (internal coordinate commands) – SCALar commands CONStraints (setup, DROPlet, SBOUnd)– Miscellaneous commands– GENErate, PATCh, DELEte, JOIN, RENAme,– IMPAtch (all PSF modification commands)– MERGE QUANtum ** ++– QUICk REWInd (not fully supported on the Intel)– SOLANA SELECT DEFINE MONITOR TEST CMDPAR and flow control PATH 

RXNCOR– Command line parameters (where supported by compiler)– RISM, ZMAT, AUTOGEN, CALC, BOUND, HELIX, WHAM, GRAPHICS, 

UMBRELLA, SBOUNDARY, PBEQ ++, GSBP ** = computational intensive ++ parallel development underway

Page 11: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

11Computational Science &  Engineering Department

Non­functional code

• Nonfunctional code in parallel version: – ANAL (table generation)– DYNAmics (old integrator, NOSE integrator, 4D)– MMFP TRAVEL VIBRAN (quasi, crystal)– BLOCK FREE– COOR COVARIANCE– ST2 waters– NMR, DIMB,ECONT, PULL, CFTI, LUP, GALGOR, BYCU, MC 4D, 

DYNA, SCPISM • Untested Features (we don't know if it works or not): 

– ANALysis– MOLVIB (minor problems with I/O ­ hangs the job)– PRESsure (the command)– RMSD,MBOND,MMFF SHAPES CLUSTER

Page 12: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

12Computational Science &  Engineering Department

CHARMM Data Structures (i)

1) Residue Topology File (RTF)– Holds atoms, atomic properties, bonds, bond angles, torsion angles, 

improper torsion angles, hydrogen bond donors and acceptors and antecedents, and non­bonded exclusions are all specified on a per residue basis. The term "residue" is somewhat historical, but can be any basic unit.

2) The Parameters (PARA or PARM)– The parameters specify the force constants, equilibrium geometries, Van der 

Waals radii, and other such data needed for calculating the energy.3) Structure File (PSF)

– The structure file is the concatenation of information in the RTF. It specifies the information for the entire structure. It has a hierarchical organization 

• atoms• residues• segments

Each atom is uniquely identified within a residue by its IUPAC name, residue identifier, and its segment identifier. Identifiers may be up to 4 characters in length.

Page 13: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

13Computational Science &  Engineering Department

CHARMM Data Structures (ii)

4) The Internal Coordinates (IC)– The internal coordinates data structure contains information concerning the 

relative positions of atoms within a structure. This data structure is most commonly used to build or modify cartesian coordinates from known or desired internal coordinate values. It is also used in conjunction with the analysis of normal modes. Since there are complete editing facilities, it can be used as a simple but powerful method of examining or analyzing structures.

5) The Coordinates (COOR)– Cartesian coordinates for all the atoms in the PSF. There are two sets of 

coordinates provided. • The main set is the default used for all operations involving the positions of the 

atoms. • A comparison set (also called the reference set) is provided for a variety of 

purposes, such as a reference for rotation or operations which involve differences between coordinates for a particular molecule. 

     Associated with each coordinate set is a general purpose weighting array (one element for each atom).

Page 14: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

14Computational Science &  Engineering Department

CHARMM Data Structures (iii)

6) The Non­bonded List (NBON)– The non­bonded list contains the list of non­bonded interactions to be used 

in calculating the energies as well as optional information about the charge, dipole moment, and quadrapole moments of the residues. This data structure depends on the coordinates for its construction and must be periodically updated if the coordinates are being modified.

7) The Hydrogen Bond List (HBON)– The hydrogen bond list contains the list of hydrogen bonds. Like the non­

bonded list, this data structure depends on the coordinates and must be periodically updated.

8) The Constraints (CONS)– There is a variety of available constraints. All data pertaining to constraints 

reside in this data structure.9) The Images data structure (IMAGES)

– The images data structure determines and defines the relative positions and orientations of any symmetric image of the primary molecule(s). The purpose of this data structure is to allow the simulation of crystal symmetry or the use of periodic boundary conditions. Also contained in this data structure is information concerning all nonbonded, H­bonds, and

Page 15: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

15Computational Science &  Engineering Department

Page 16: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

16Computational Science &  Engineering Department

CHARMM Scripts 

• CHARMM input files are scripts, executing each command in sequence,– conditionals, variables etc are available– user control of warning and exit conditions

• All CHARMM input files begin with several lines of comments. These title lines begin with a "*" as the first character and the title is terminated by a line containing only a "*". 

* Defines and builds a PSF file, then calculates the energy *

Page 17: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

17Computational Science &  Engineering Department

WRNLev

• The WRNLEV command sets the value of the WRNLEV variable in COMMON /TIMER/ to the specified value. This is used in WRNDIE and elswhere. 

• Suggested values :

­5,5  warnings associated with fatal errors (see BOMBlev). 5  default should print brief warning and error messages 

for conditions that will affect outcome. 6  more extensive information on errors and some 

information on normal partial results and conditions 7  verbose error messages and more normal processing 

information for debugging 8  all information that might be relevant to an error 

condition plus checking results 9,10  debugging levels for anything you might conceivably 

want.10  or higher for term by term outputs from energy 

routines, or other tasks where huge amounts of data useful only in debugging might be generated.

Page 18: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

18Computational Science &  Engineering Department

BOMBlev

• The BOMBlev command sets the level which determines the types of errors which will terminate the program. 

• The default is zero. A value of ­1 is suggested for interactive use. Suggested values are; 

­5,­4  Limit exceeded type of errors. Run only as debug.­3,­2  Severe errors where results will be incorrect if continued. ­1  Moderately severe errors, results may be bad. 0  Parsing type errors. Some important warnings. 1,2  Serious warnings. 3,4,5  Assorted minor warnings (see WARNlev for their suppresion). 

Page 19: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

19Computational Science &  Engineering Department

CHARMM Commands : READ

• The first word in every command line specifies the command.– The command line is written in free format and is generally written 

to the standard output.– Most commands have several options, these follow the command 

word in the form of specific keywords. – In most cases only the first four letters of the keyword are required. 

For clarity we will capitalize the first four characters of each command.

• Example: To open and read in the topology (top_all22_prot.inp) and the parameter files (par_all22_prot.inp), the CHARMM commands are

OPEN READ FORMatted UNIT 27 NAME top_all22_prot.inp READ RTF CARD UNIT 27 OPEN READ FORMatted UNIT 28 NAME par_all22_prot.inp READ PARA CARD UNIT 28

Page 20: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

20Computational Science &  Engineering Department

CHARMM Scripts ­ Generation of PSF

• The next step to setting up a CHARMM calculation is the generation of the PSF file for your particular system. 

• First, the sequence must be specified, this can either be done by typing in the sequence or by reading it in from the coordinate file. 

• The PSF is built using the GENErate command. 

! Read Sequence for Polyalanine  ! This is a comment line READ SEQU CARD  ! The read sequence command * Poly­alanine sequence ! Title line * ! End of title line 6 ! Number of residues ALA ALA ALA ALA ALA ALA ! Specify the residues GENErate ALA6 SETUp ! Command to generate the psf

– ALA6 is the name associated with the sequence of six alanine residues and the SETUp keyword specifies that the internal coordinate table should be constructed. 

– By default, N and C terminal groups are added during the generate statement. 

Page 21: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

21Computational Science &  Engineering Department

CHARMM Setup, other aspects 

• Protonation– Protonation states are modified by changing the name of a residue 

in the SEQuence, e.g.• HSD vs HSE for delta vs epsilon histidine

• READ COOR– Coordinates are loaded once PSF has been set up, identified by 

atom names (ATOM,RESIDUE,SEGMENT triples)• HBUIld

– HBUIld can use the internal coordinate tables provided as part of the RTF to place missing hydrogen atom

• Atom relabelling – for historical reasons, certain atoms have names in the RTF which 

don’t match PDB entries.• PDB can be edited, but alternatively PSF can be created and then 

edited before reading coordinates

Page 22: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

22Computational Science &  Engineering Department

CHARMM Selection Tools

• Atom selection tools are a strong feature of CHARMM

• Can be used on many commands to apply them to an atom subset

• Selection operators include– by atom, residue, segment name– by proximity– by coordinate value– by property– …– by logical combination of other selections

Page 23: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

23Computational Science &  Engineering Department

CHARMM Selection Examples

sele atom * * CA end    ! will include all C alphas in the list.

sele .not. type H* end  ! will include all atoms that are not hydrogens.

sele atom MAIN 1 * .around. 5.0 end                        ! will include all atoms that are within a sphere                        of radius 5.0 around any atom of the residue MAIN 1.

sele bynu 1 : 100 end   ! will include atoms number 1 to 100.

sele resid 1 : 10 .and. segid. MAIN .and. .not. ( type H .or. type N .or. type O ) end                        ! will include all the atoms of reside 1 to 10                        in the segment MAIN except atoms H, N, and O.

sele bynu 1 .or. bynu 3 .or. bynu 5 .or. bynu 7 .or. bynu 8 ­     bynu 11 .or. bynu 13 .or. bynu 15 .or. segid SOLV end         ! will include atoms number 1, 3, 5, 7, 8, 11, 13, and 15, and the SOLV segment.

! to select side chain atoms in the polygen all atom parameter set ! where mb is the myoglobin protein sele segid mb .and. .not. ( type n .or. type ca .or. type c .or. ­        type o .or. type oct* .or. type ha* .or. type hn .or. type ht* ) end 

sele prop abs charge .gt. 0.5 end                ! select all atoms with charge > 0.5 or charge < ­0.5

Page 24: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

24Computational Science &  Engineering Department

Stream Files and Parallel Systems

Most MPI systems do not allow rewind of stdin which means charmm input files containing "goto" statements would not work if invoked directly (this example uses MPICH):

poe $exe  < my.inp > my.out [charmm options]

workaround: 

poe $exe  < my.stdin > my.out ZZZ=my.inp [charmm options] 

where the file my.stdin just streams to the real inputfile:

* Stream to real file given as ZZZ=filename on command line. Note that the filename * cannot consist of a mixture of upper­ and lower­case letters. *stream @ZZZ stop 

Page 25: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

25Computational Science &  Engineering Department

Handling of non­bonded interactions

• RECOMMENDED:   Presented here is a suggested list of options. Where specifications are missing, substitute the defaults:

• For no­cutoff periodic systems:– NBONDS ATOM EWALD PMEWALD KAPPA 0.32  FFTX 32 FFTY 32 FFTZ 32 ORDER 6  

CUTNB 12.0  CTOFNB 10.0  VDW  VSHIFT  • (** system size dependent ­ use about 0.8­1.0 grids per angstrom)• For atom based cutoffs:

– NBONDS  ATOM  FSHIFT CDIE  VDW VSHIFT  CUTNB 13.0  CTOFNB 12.0 CTONNB 8.0  WMIN 1.5  EPS 1.0

• or (perhaps better for longer cutoff distances, but more expensive)– NBONDS  ATOM  FSWITCH CDIE  VDW VSHIFT CUTNB 13.0  CTOFNB 12.0 CTONNB 8.0  

WMIN 1.5  EPS 1.0• For group based cutoffs (doesn't vectorize well):

– NBONDS  GROUP  FSWITCH CDIE  VDW VSWITCH  CUTNB 13.0  CTOFNB 12.0 CTONNB 8.0  WMIN 1.5  EPS 1.0

• For extended electrostatics :– NBONDS  GROUP  SWITCH CDIE  VDW VSWI  EXTEND GRAD QUAD CUTNB 13.0  

CTOFNB 12.0 CTONNB 8.0  WMIN 1.5  EPS 1.0

For a better description of these methods and how they perform, see: P.J. Steinbach, B.R. Brooks: "New Spherical­Cutoff Methods for Long­Range Forces in Macromolecular Simulation,"  J. Comp. Chem. 15, 667­683 (1994).

Page 26: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

26Computational Science &  Engineering Department

Non­recommended Nonbond options

[ ATOM  ] [ CDIElec ] [ SHIFted  ]   no (obsolete, but used in the past)[ ATOM  ] [ CDIElec ] [ SWITched ]   NO!  Very bad ­ do not use![ GROUp ] [ CDIElec ] [ SHIFted  ]   no (obsolete)[ GROUp ] [ CDIElec ] [ SWITched ]   NO!  Very bad with non­neutral groups![ ATOM  ] [ RDIElec ] [ SHIFted  ]   yes, but do you really want RDIE??[ ATOM  ] [ RDIElec ] [ SWITched ]   no. switch is bad here.

Page 27: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

27Computational Science &  Engineering Department

CHARMM Integrators

There are four separate dynamics integrators available in CHARMM:

Name  Keyword  Module Original Verlet  ORIG  dynamcv.src Leapfrog Verlet  LEAP  dynamc.src (default) Velocity Verlet  VVER dynamvv.src 4­D L­F Verlet  VER4  dynam4.src New vel. Verlet  VV2  dynamvv2.src

*does not apply to multi­body dynamics, which has a separate set of integrators. 

Page 28: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

28Computational Science &  Engineering Department

Worked Example

• Taken from Roland Stotes CHARMM Tutorial

• This is the second example, for a periodic water box– PSF Generation– Energy Calculation– Molecular Dynamics (Heating, Equilibration, Production)

• See http://www.ch.embnet.org/MD_tutorial/

Page 29: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

29Computational Science &  Engineering Department

PSF Generation* Generate PSF for water**! read the topology and parameter fileopen read formatted unit 12 name top_all22_prot.inpread rtf card unit 12open read formatted unit 12 name par_all22_prot.inpread para card unit 12! Generate water psf and coordinatesset 4 bulk ! water identified! read box of equilibrated wateropen unit 1 read formatted name tip3p.crdread sequence unit 1 coorrewind unit 1! generate new segment id and psfgenerate bulk noangle nodihedral! read water box coordinatesread coor card unit 1close unit 1! verify location of water boxCOOR STATISTICS SELE ( SEGID bulk ) END! write out the psf and the coordinatesopen unit 1 write formatted name scr/@4.psfwrite psf card unit 1* PSF*open unit 1 write formatted name scr/@4.pdbwrite coordinate pdb unit 1* COORdinates*STOP

Note that in this input file, we make use of a variable definition; the variable 4 is assigned the character string bulk, which, in turn, is used (@4) for defining the name of the output files.

The initial coordinate set (tip3p.crd) is a cube of preequilibrated water that was generated in an earlier calculation

The number of water molecules is determined by reading in the water sequence from the coordinate file (read sequence).

The generate command builds the PSF and assigns the segment ID bulk for bulk water. 

The coor statistics command verifies the position of the box; it should be near (0.0, 0.0, 0.0)

Finally, the PSF and the coordinate file are written to disk.

Page 30: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

30Computational Science &  Engineering Department

Heating: Initial Setup* system heating to 300 K*! { parameters}set t 300?   ! temperatureset n bulk1?  ! output files! read the topology and parameter fileopen read formatted unit 12 name top_all22_prot.inpread rtf card unit 12open read formatted unit 12 name par_all22_prot.inpread para card unit 12! { psf }open unit 1 read formatted name scr/bulk.psfread psf card unit 1close unit 1! { coordinates }OPEN UNIT 1 READ FORMatted NAME scr/bulk.pdbREAD COORdinate PDB UNIT 1CLOSE UNIT 1

!size of box, must use variable 9 to be consistent with waterbox.imgset 9 18.856!read in image file for translation imagesopen unit 8 read card name waterbox.imgread imag unit 8image byres xcen 0.0 ycen 0.0 zcen 0.0 sele all end

Set variable 9

Page 31: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

31Computational Science &  Engineering Department

Image Transformation File

* IMAGE transformation file for an infinite cube with an edge* length passed as CHARMM parameter 9* ...*! Scale all transformations by parameter 9SCALE @9 @9 @9! Define the 26 image objects required for each face, edge,! and vertex of the primary cube. To construct the image! name, use the letters X, Y, and Z for positive x, y,! and z directions; use the letters A, B, and C for! negative x, y, and z directions.! Define adjacent IMAGE in x directionIMAGE XTRANS 1.0 0.0 0.0! Define adjacent IMAGE in the −x directionIMAGE ATRANS −1.0 0.0 0.0! Define adjacent IMAGE in y directionIMAGE YTRANS 0.0 1.0 0.0! Define adjacent IMAGE in −y directionIMAGE BTRANS 0.0 −1.0 0.0……...

Size of cubic box comes from calling script

Page 32: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

32Computational Science &  Engineering Department

Heating (i) : Energy Parameters

! use shakeshake bonh para

! energy parametersenergy cutnb 10.0 cutim 10.0 ctonnb 8.0 ctofnb 9.0 −vswitch shift cdie eps 1

Control parameters for energy calculationcutnb ­ cutoff for non­bonded termscutim ­ cutoff distance between primary and imagectonnb, ctofnb ­ range of the switching functionvswitch ­ use switching function for VDW energiesshift ­ use shifted potential for electrostatics

Apply shake to bonds including hydrogens, constrain distances to values from the parameter file

Dielectric settingscdie ­ constant dielectriceps ­ epsilon 1 (vacuum)

Page 33: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

33Computational Science &  Engineering Department

Heating (ii) : Molecular Dynamics

! md runopen write formatted unit 31 name scr/@n.resdyna leap verlet start ­ nstep 6000 timestep 0.001 −iseed 12310238 firstt 0 finalt 300 −ihtfrq 10 teminc .5 −ieqfrq 0 iasors 1 iasvel 1 −isvfrq 500 iprfrq 500 nprint 100 −iunrea −1 iunwri 31 iuncrd −1 −imgfrq 10 inbfrq 10

! write out coordinatesopen write card unit 20 name scr/@n.pdbwrite coor pdb unit 20* COORdinates*STOP

The keywords INBFrq and IMGFrq specify the frequency with which to update the nonbond interaction list and the image atom list, respectively.

The energies are written out every 100 steps (NPRInt) and their averages are calculated every 500 steps (IPRfrq).

IUNWrite indicates to which file the information needed to restart the trajectory will be written, (unit 31, file bulk1.res)

The velocities are periodically and randomly chosen from a Gaussian distribution (iasors1 iasvel 1) at the new temperature, RNG initialised with iseed

IHTfrq indicates that a temperature increment will be performed every 10 integration steps.

The simulation is run for 6000 steps using a 0.001 picosecond time steps (NSTEp, TIMEstep). 

start specifies that this is the beginning of a simulation. 

The simulation starts at 0 K and the system is heated up to 300 K using 0.5 K increments (FIRSTT, FINALT, TEMInc) every 10 fs (= 0.01 ps).

Page 34: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

34Computational Science &  Engineering Department

Parallel Builds of CHARMM

• Message­passing implementation of CHARMM predates availability of MPI, incorporates extensive implementation of collectives operations.1. < no extra keywords > (Calls to MPI collective routines)2. CMPI MPI (non­blocking cube topology using send/receive from MPI)3. CMPI MPI GENCOMM (non­blocking ring topology, MPI send/receive)4. CMPI MPI SYNCHRON (blocking cube topology, MPI send/receive)5. CMPI MPI GENCOMM SYNCHRON (blocking ring topology, MPI 

send/receive)

• HPCx provided builds are of two types– “standard” build (no GAMESS­UK) uses option 1, making use of IBM 

collectives.– QM/MM Build supporting NEB uses option 3. This allows the 

CHARMM message passing layer to create process groups for the parallel implementation

Page 35: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

35Computational Science &  Engineering Department

CHARMM Parallel Performance

• Joint Amber/CHARMM benchmark

24

816

3264

0

500

1000

1500

2000

2500

3000

3500

4000

4500

5000

5500

6000

Scalability of phases

Shake Setup

First List

Shake time

Comm coords

dynamc 

other List time 

xdistm setup

xdistm Build list

Direct Ewald time 

other Recip Ewald time

Fill charge grid

Scalar sum 

Grad sum 

other FFT

FFTcomm 

other Nonbond force

other Energy time 

other INTRNL energy

Bond energy

Angle energy

Dihedral energy 

Restraints energy

Comm force 

Procs

Time * Procs

0 10 20 30 40 50 60 70 80 90 100 110 120 13010

2030405060

708090

100110120130140

150160170180

190200

Column G

Column H

Column I

Procs

Tim

e

Page 36: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

36Computational Science &  Engineering Department

Larger Simulation

• System consisted of ~118000 atoms, solvated protein in the RHDO cell with 118A edge.

• The test calculation was a 10 ps simulation (5000 steps with 0.002 timestep, run from the restart file) with periodic boundary conditions, using PME; 14 A cutoff. 

No of cpus     Elapsed time          Speed­up32                    2.87 h                      164                    1.31 h                      2.19128                 46.22 min         3.72

• Thanks to Jolanta Zurek, Bristol

Page 37: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

37Computational Science &  Engineering Department

The QM/MM Modelling Approach

• Couple QM (quantum mechanics) and MM (molecular mechanics) approaches

• QM treatment of the active site– reacting centre– excited state processes (e.g. 

spectroscopy)– problem structures (e.g. complex 

transition metal centre)

• Classical MM treatment of environment

– enzyme structure– zeolite framework– explicit solvent molecules– bulky organometallic ligands

Page 38: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

38Computational Science &  Engineering Department

D. Das, K. P. Eurenius, E. M. Billings, P. Sherwood, D. C. Chatfield, M. Hodošček, and B. R. Brooks J. Chem. Phys., 2002 , 117, 10534­10547

GAMESS­UK Interface with CHARMM

• Interface to GAMESS­UK has been implemented in collaboration with Bernie Brooks, Eric Billings, Lee Woodcock (NIH, Bethesda Maryland)

• GAMESS­UK is incorporated into CHARMM as an extra “forcefield term”

• Ideal for the CHARMM user community when a quantum contribution to the forcefield is required

• Implements a number of developments to the QM/MM coupling schemes:– Gaussian delocalised point charges implemented in GAMESS­

UK, based on 2­ and 3­ centre integral and derivative integral drivers from the CCP1 DFT module.

• Supports parallel computation of reaction paths (Replica Path and Nudged Elastic Band) methods

• Other quantum options ­  Semi­empirical,SCC­DFTB, GAMESS(US)

Page 39: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

39Computational Science &  Engineering Department

Using GAMESS­UK with CHARMM

• Create a GAMESS­UK deck without the coordinates section• adapt off & nosym to avoid re­orientation and problems with 

symmetry breaking• runtype gradient usually needed• charge is interpreted with reference to QM atoms only

titleqm region for charmm charge ­1adapt offnosymbasis sto3gscftype rhfruntype gradientvectors atomsenter 1

Page 40: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

40Computational Science &  Engineering Department

Using GAMESS­UK within CHARMM

• Within CHARMM– Add link atoms

• using ADDL command• manual edits of the topology

– set environment variable to preserve ed3 between calls– use gamess command to define QM region (from a charmm 

selection) and set up QM/MM options

addl qqh1 mpep 1 c mpep 1 ca

define qm sele atom mpep 1 c  .or. atom mpep 1 ot1 ­           .or. atom mpep 1 ot2 end

envi "ed3" "ed3"gamess remove sele qm end

fast off 

Page 41: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

41Computational Science &  Engineering Department

• QM region 35 atoms (DFT BLYP) – include residues with possible proton donor/acceptor roles – GAMESS-UK, MNDO, TURBOMOLE

• MM region (4,180 atoms + 2 link)– CHARMM force-field, implemented in CHARMM, DL_POLY

CHARMM QM/MM Performance

Triosephosphate isomerase  (TIM)

• Central reaction in glycolysis, catalytic interconversion ofDHAP to GAP• Demonstration case within QUASI (Partners UZH, and BASF)

Measured Time (seconds)

T T 128128 (IBM SP/p690) = 143 secs (IBM SP/p690) = 143 secs  

1030

1487

714 797

540

778

419 431

308

428

274246

196

257213

170

0

400

800

1200

1600

8 16 32 64

CS9 P4/2000 + Myrinet 2kSGI Origin3800/R14k­500AlphaServer SC ES45/1000IBM SP/Regatta­H

Number of CPUs

Page 42: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

42Computational Science &  Engineering Department

QM/MM Timings

• DFT QM/MM calculations on the chorismate mutase (24 atoms for the QM region on the B3LYP/6­31G* level of theory, 7053 atoms in the MM region CHARMM22 parameter set), and are for 50 steps in a MD run:

no of procs CPU time32            91.2  minutes64            64.2  minutes128          49.45 minutes256          43.77 minutes

Thanks to Fred Claeyssens, Bristol.

Page 43: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

43Computational Science &  Engineering Department

The Replica Path Method

• The method involves the simultaneous optimisation of a series of geometries of the reacting system, corresponding to a series of points along the reaction pathway.

• The replica path approach has been tested on the chorismate / prephenate rearrangement, illustrating how the PMF approach, based on the constraint forces acting on the non­equilibrium path structures can be used to extract a measure of the thermodynamics of the reaction from the active site atoms.

• The intermediates can be estimated by interpolation, as in the chorismate mutase reaction:

Page 44: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

44Computational Science &  Engineering Department

E rms=∑i=1

N 12

K r r i−r 2

ri=RMSDbestfit i ,i1 r=∑i=1

N ri

N

The Replica Path Method (i)

• The target function for the combined minimisation comprises the sum of the configurational energies, together with a series of penalty functions which ensure that the structures represent the reaction path. 

• In the CHARMM implementation the important penalty terms include a term ensuring that the

• points are equally spaced in coordinate space, computed by taking the RMSD for the cartesian coordinates of successive points using the best fit (RMS) orientation the distance between each pair of adjacent structures is compared with the mean of all such distances using a harmonic penalty function.

Page 45: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

45Computational Science &  Engineering Department

Replica Path Method (ii)

• A similar term, related to the angles in coordinate space (computed from the distances between successive groups of three points)

• provides a penalty term when significant deviations occur from linearity, thus avoiding paths that double back on themselves. COSMAX is a parameter which determines the largest angle for which no constraint is applied (set to 0.975 in this study), the term Eangle is set to zero for cos(Θ)  ≤ COSMAX.

Eangle=∑i=1

N 12

Kangle COSMAX−cos i 2

Page 46: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

46Computational Science &  Engineering Department

The Replica Path Method (iii)

• The non­equilibrium nature of the points on the pathway can be used to integrate the energetics of the reaction using a PMF (potential of mean force) formalism:

RMS(i,j) is the weighted best­fit coordinates of structure i fitted onto structure j as a reference∇E(i) is the negative force on the structure at point i, excluding the constraint forces.

• In future it is expected that the PMF approach may be used in conjunction with an MD simulation of the replicated system to access free energies of activation

PMF N =∑i=3

N−1

[∇ E i−1⋅RMS i ,i−1−RMS i−2,i−1 4 ][∇ E i ⋅ RMS i1,i −RMS i−1, i

4 ]

Page 47: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

47Computational Science &  Engineering Department

N o n - R e p l i c a t e dM M R e g i o n

Q MR e g i o n

R e p l i c a t e d M MR e g i o n

H.L. Woodcock, M. Hodoscek, P. Sherwood, Y.S. Lee, H.F. Schaefer III, B.R. Brooks, Theo. Chem. Acc (2003) 109, 140-148.

QM/MM Replica Path

• The system is divided into three regions. – Part of the system may be unreplicated, so that all points on the pathway 

can share a common environment which optimised to a compromise configuration. If used with care, this helps to ensure that the study of the reaction is not complicated by changes in the conformation of spectator groups, or solvent rearrangements. 

– Within the replicated region, a subset of atoms may be specified as QM. 

Page 48: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

48Computational Science &  Engineering Department

Alternative approach approach in which all processors work together on each point in turn.

This is expected to be the method of choice when the number of points to be computed exceeds the number of processors.

Replica Path Parallelisation

• Classical part of the system, (both replicated and non­replicated MM regions), is computed using the standard CHARMM parallel code. 

• For the QM calculation, however, the CHARMM communication subsystem is switched such that the processors are grouped into independent sets, each set working on one of the points on the pathway. 

• The converged wavefunction for each point is maintained ready to initialise the next calculation.

P37

3366

P5

P33

3322

P34

3333

P2P1

P35

3344

P36

3355

P4P3

Reaction Coordinate

E

Page 49: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

49Computational Science &  Engineering Department

Chorismate/Prephenate moiety , the only part treated by QM methods (thus avoiding any bonded QM/MM junctions

Replicated part of the system (6 Å cutoff) – with a different geometry at each point on the reaction path - is highlighted.

Chorismate Mutase Test System

• Solvated system, leading to a total of ca 1500 atoms. Only one of the active sites in the trimeric enzyme was treated by the replica approach, the remainder by MM.

• The Chorismate to Prephenate rearrangement found to have ∆H†† and ∆Hrxn values of 14.9 and ­19.5 kcal/mol. The activation enthalpy compares favourably with the expt.value of 12.7±0.4 kcal/mol. 

• Close agreement between the energy profiles obtained from direct energetic analysis and from the PMF integration approach.

Page 50: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

50Computational Science &  Engineering Department

Test System: Chorismate Mutase

Page 51: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

51Computational Science &  Engineering Department

Computed Energy Profiles

Page 52: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

52Computational Science &  Engineering Department

Results

• The Chorismate to Prephenate rearrangement was found to have a ∆H†† and ∆Hrxn values of 14.9 and ­19.5 kcal/mol. The activation enthalpy compares favourably with the experimental value of 12.7±0.4 kcal/mol [4]. 

• From the shapes of the curves shown right it can be seen that there is close agreement between the energy profiles obtained from direct energetic analysis and from the PMF integration approach.

• In this test system the geometrical changes were localised to the active site by the choice of replicated region but in studies of more complicated systems it is to be expected that the PMF approach will enable more reliable energetics to be obtained, minimising the influence of conformational changes away from the active site.

Page 53: An Introduction to CHARMM on HPCx - cse.scitech.ac.uk · An Introduction to CHARMM on HPCx ... (ab initio part) ... – Most commands have several options, these follow the command

   

Computational Science & Engineering DepartmentCSECSE

53Computational Science &  Engineering Department

Running CHARMM on HPCx

• Roland Stote Tutorial– See http://www.ch.embnet.org/MD_tutorial/– to simplify your work, the same example files can be found in 

/usr/local/packages/charmm/tutorial/example1 etc– It is suggested you run the binary

/usr/local/packages/charmm/c32b1/exec/ibmaixmp/charmm

• QM/MM Examples– It is suggested you run the binary

/usr/local/packages/charmm/c32a1_neb/exec/ibmaixmp/charmm– some sample files for replica path/NEB can be found in 

/usr/local/packages/charmm/c32a1/neb_test_cases/• A CHARMM licence is needed for users to run on HPCx, send a 

request for access.• Links to Cut and Paste (and older presentations)

ftp://ftp.dl.ac.uk/qcg/hpcx_chem/index.html