DNA-Specific (But Generally Applicable) AMBER With GROMACS 3.3.x: Installation And Notes

The following is the full procedure for installing the AMBER force field port for GROMACS (AMBER-in-GROMACS, AMBER-with-GROMACS, AMBER-on-GROMACS, whatever you want to call it) developed by Eric Sorin at California State University, Long Beach, providing a bit more depth in the installation process (specifically for GROMACS 3.3.x) and a few modified GROMACS files.

As brief background, AMBER (Assisted Model Building and Energy Refinement) is one of THE dominant molecular mechanics/molecular dynamics (MM/MD) force fields used today in biochemical simulations. The motivation for this page (my installing AMBER for use in GROMACS) stems from the current Nanorex focus on Structural DNA Nanotechnology (SDN) modeling, for which we’re working on a reduced model force field for large-structure energy minimizations and, importantly, integrating the GROMACS MM/MD package for use via our CAD interface. You can read more about this in the poster presented at FNANO08 this past April. As a force field validated for DNA simulations, AMBER meets our needs of performing atomistic simulations on DNA nanostructures. While NAMD is also a possibility for DNA simulations, GROMACS meets Nanorex’s open source needs.

Needless to say, finding that Sorin and co-workers had ported AMBER to GROMACS was a wonderful discovery (and that this same port appears to be driving the Folding@Home project). The installation directions on the AMBER-on-GROMACS website are good, but they don’t mention a few important steps that I spent no small amount of time trying to figure out (and I’m definitely not complaining. 99% of the work was the porting, which has been graciously handed to the GROMACS community on a silver platter). Below is the complete set of steps required to get, as the first example, the Dickerson.pdb sample file provided with the porting files to energy minimize and MD correctly. Issues related to DNA-based simulations not using the Dickerson.pdb file will be covered in another post.

Dickerson DNA

QuteMol rendering of Dickerson.pdb (from Drew, H. R., Wing, R. M., Takano, T., Broka, C., Tanaka, S., Itakura, K. & Dickerson, R. E. (1981). Structure of a B-DNA dodecamer: conformation and dynamics. Proc. Natl. Acad. Sci. USA 78, 2179-2183. Protein Data Bank structure 1BNA).

Install/compile a custom installation of GROMACS

The AMBER port to GROMACS does not require modification of the GROMACS code but does require a few changes to force field text files. In the interest of remembering what was changed and what wasn’t, I recommend a custom compilation of GROMACS or, at the very least, the installation of another copy of GROMACS you can modify the top directory of without risking changes to an already working GROMACS version.

If you don’t know how to compile your own version of GROMACS, I recommend taking a look at Compiling Single-Precision And Double-Precision GROMACS 3.3.3 With OpenMPI 1.2.6 Under OSX 10.5 (Leopard).

My installation directory is /usr/local/gromacs333-amber (which I will refer to here as /ULG-A/ and all directory calls will be to this. Obviously, change all directory calls to match yours.

Download GROMACS-Ported AMBER force field files

I’m running a double-precision MPI version of GROMACS 3.3.3, meaning I’m using the GROMACS-ported AMBER force field files for GROMACS 3.3.1 (May 2006). And get the version “with pdfs.” If you’re going to be doing these calculations, you should know where the math come from!

Copy vdwradii.dat and aminoacids-NA.dat into /usr/local/gromacs-amber/share/gromacs/top

You will need to be logged in as root to do this (sudo cp FILENAME /ULG-A/top). The AMBER port file vdwradii.dat differs from the vdwradii.dat file in the /ULG-A/top directory of the GROMACS install by the addition of 5 lines:

???  P     0.15
???  LP1   0
???  LP2   0
LYSH MNZ1  0
LYSH MNZ2  0

With no removals or number changes.

The aminoacids.dat file is a little different. In order to use pdb2gmx to generate nucleic acid topology files, GROMACS requires the list of residue codes that reside in aminoacids-NA.dat. So far as I can tell, using aminoacids-NA.dat instead of aminoacids.dat does not change the handling of amino acids (why two files exist for a reason other than amino acid-centric organization is beyond my pay scale), so we’ll be using aminoacids-NA.dat exclusively.

Move/delete/rename aminoacids.dat and rename aminoacids-NA.dat to aminoacids.dat

The aminoacids-NA.dat file includes 32 additional residue codes, accounting for the 3′ (includes terminal H atom), 5′ (included terminal H atom), in-strand (nucleic acid repeat unit) and molecule (individual hydrogen-terminated sugar and nucleic acid) topology information codes for DNA and RNA found in the .rtp files

Copy the ffamber files of interest into the /ULG-A/top directory

If you’re doing this in Linux or OSX, you might as well move all of the files you want installed into a single directory and su cp * /ULG-A/top. Note that the .itp and .gro files in your ffamber_v3.3.1 (for the 3.3.x GROMACS) are the same for all of the AMBER force field flavors you can install. Further, all of the ffamber* files have unique names (94, 99, 03, etc.), so you can install all the force field files into /ULG-A/top and use whichever.

Modify /ULG-A/top/FF.dat to reflect the new force field files

The FF.dat file as installed by GROMACS looks like the following:

9
ffG43a1  GROMOS96 43a1 force field
ffG43b1  GROMOS96 43b1 vacuum force field
ffG43a2  GROMOS96 43a2 force field (improved alkane dihedrals)
ffG45a3  GROMOS96 45a3 force field (Schuler JCC 2001 22 1205)
ffG53a5  GROMOS96 53a5 force field (JCC 2004 vol 25 pag 1656)
ffG53a6  GROMOS96 53a6 force field (JCC 2004 vol 25 pag 1656)
ffoplsaa OPLS-AA/L all-atom force field (2001 aminoacid dihedrals)
ffencadv Encad all-atom force field, using scaled-down vacuum charges
ffencads Encad all-atom force field, using full solvent charges    

To include the AMBER force field files (so that these separate files can be called during pdb2gmx), we modify the FF.dat file by (1) incrementing the total number of force fields and (2) adding the force field code and text description to this file. The new FF.dat file will look like this if you added all of the ffamber force field files:

17
ffG43a1  GROMOS96 43a1 force field
ffG43b1  GROMOS96 43b1 vacuum force field
ffG43a2  GROMOS96 43a2 force field (improved alkane dihedrals)
ffG45a3  GROMOS96 45a3 force field (Schuler JCC 2001 22 1205)
ffG53a5  GROMOS96 53a5 force field (JCC 2004 vol 25 pag 1656)
ffG53a6  GROMOS96 53a6 force field (JCC 2004 vol 25 pag 1656)
ffoplsaa OPLS-AA/L all-atom force field (2001 aminoacid dihedrals)
ffencadv Encad all-atom force field, using scaled-down vacuum charges
ffencads Encad all-atom force field, using full solvent charges
ffamber94 AMBER94 Cornell et al. (1995), JACS 117, 5179-5197
ffamber96 AMBER96 Kollman (1996), Acc. Chem. Res. 29, 461-469
ffamberGS AMBER99GS Garcia & Sanbonmatsu (2002), PNAS 99, 2782-2787
ffamberGSs AMBER99GSs Nymeyer & Garcia (2003) PNAS 100, 13934-13939
ffamber99 AMBER99 Wang et al. (2000), J. Comp. Chem. 21, 1049-1074
ffamber99p AMBER99p Sorin & Pande (2005). Biophys. J. 88(4), 2472-2493
ffamber99SB AMBER99sb Hornak et. al (2006). Proteins 65, 712-725
ffamber03 AMBER03 Duan et al. (2003), J. Comp. Chem. 24, 1999-2012

Add and increment numbers as appropriate for the force field you want to use. You can download the complete FF.dat at the following link and comment:

Download amber_FF.txt, delete “amber_”, change “.txt” to “.dat”, place in /ULG-A/top

source /UGL-A/bin/GMXRC

The GMXRC file contains path-dependent settings for your shell.

In theory, you’re all done. At least, this is the end of the installation process according to the official AMBER-on-GROMACS list. The IMPORTANT NOTES section contains relevant information but does not complete the installation. The additional steps are provided below.

Modify the /ULG-A/top/spc.itp file

If you’re running through a complete energy minimization calculation with the website installation followed, your first source of error (hopefully) comes in the form of…

Program grompp_amber, VERSION 3.3.3
Source code file: toppush.c, line: 1193

Fatal error:
[ file "/usr/local/gromacs333_amber/share/gromacs/top/spc.itp", line 32 ]:
Atom index (1) in bonds out of bounds (1-0).
This probably means that you have inserted topology section "bonds"
in a part belonging to a different molecule than you intended to.
In that case move the "bonds" section to the right molecule.

The origin of this error is the lack of amberXX water parameters in the spc.itp file (nothing directly to do with the reported GROMACS error). The fix for this is straightforward, simply modifying the spc.itp file in the /ULG-A/top directory as follows below. The original spc.itp file below…

[ moleculetype ]
; molname       nrexcl
SOL             2

[ atoms ]
;   nr   type  resnr residue  atom   cgnr     charge       mass
#ifdef _FF_GROMACS
1     OW      1    SOL     OW      1      -0.82
2     HW      1    SOL    HW1      1       0.41
3     HW      1    SOL    HW2      1       0.41
#endif
#ifdef _FF_GROMOS96
#ifdef HEAVY_H
1     OW      1    SOL     OW      1      -0.82    9.95140
2      H      1    SOL    HW1      1       0.41    4.03200
3      H      1    SOL    HW2      1       0.41    4.03200
#else
1     OW      1    SOL     OW      1      -0.82   15.99940
2      H      1    SOL    HW1      1       0.41    1.00800
3      H      1    SOL    HW2      1       0.41    1.00800
#endif
#endif
#ifdef _FF_OPLS
1  opls_116   1    SOL     OW      1      -0.82
2  opls_117   1    SOL    HW1      1       0.41
3  opls_117   1    SOL    HW2      1       0.41
#endif

#ifdef FLEXIBLE
[ bonds ]
; i     j       funct   length  force.c.
1       2       1       0.1     345000  0.1     345000
1       3       1       0.1     345000  0.1     345000

[angles ]
; i     j       k       funct   angle   force.c.
2       1       3       1       109.47  383     109.47  383
#else
[ settles ]
; OW    funct   doh     dhh
1       1       0.1     0.16330

[ exclusions ]
1       2       3
2       1       3
3       1       2
#endif

is modified to this…

[ moleculetype ]
; molname       nrexcl
SOL             2

[ atoms ]
;   nr   type  resnr residue  atom   cgnr     charge       mass
#ifdef _FF_GROMACS
1     OW      1    SOL     OW      1      -0.82
2     HW      1    SOL    HW1      1       0.41
3     HW      1    SOL    HW2      1       0.41
#endif
#ifdef _FF_GROMOS96
#ifdef HEAVY_H
1     OW      1    SOL     OW      1      -0.82    9.95140
2      H      1    SOL    HW1      1       0.41    4.03200
3      H      1    SOL    HW2      1       0.41    4.03200
#else
1     OW      1    SOL     OW      1      -0.82   15.99940
2      H      1    SOL    HW1      1       0.41    1.00800
3      H      1    SOL    HW2      1       0.41    1.00800
#endif
#endif
#ifdef _FF_OPLS
1  opls_116   1    SOL     OW      1      -0.82
2  opls_117   1    SOL    HW1      1       0.41
3  opls_117   1    SOL    HW2      1       0.41
#endif

#ifdef _FF_AMBER94
; also applies to FF_AMBER96, FF_AMBERGS, and FF_AMBERGSs
1  amber94_42   1  SOL     OW      1      -0.82  15.99940
2  amber94_27   1  SOL    HW1      1       0.41   1.00800
3  amber94_27   1  SOL    HW2      1       0.41   1.00800
#endif

#ifdef _FF_AMBER99
; also applies to FF_AMBER99P, FF_AMBER99SB, FF_AMBER03
1  amber99_54   1  SOL     OW      1      -0.82  15.99940
2  amber99_55   1  SOL    HW1      1       0.41   1.00800
3  amber99_55   1  SOL    HW2      1       0.41   1.00800
#endif



#ifdef FLEXIBLE
[ bonds ]
; i     j       funct   length  force.c.
1       2       1       0.1     345000  0.1     345000
1       3       1       0.1     345000  0.1     345000

[ angles ]
; i     j       k       funct   angle   force.c.
2       1       3       1       109.47  383     109.47  383
#else
[ settles ]
; OW    funct   doh     dhh
1       1       0.1     0.16330

[ exclusions ]
1       2       3
2       1       3
3       1       2
#endif

This FFAMBER-included spc.itp file is downloadable in the following form and comment:

Download amber_spc.txt, delete “amber_” change “.txt” to “.itp”, place in /ULG-A/top

At this point, pdb2gmx, editconf, genbox, grompp, and genion should all work without error. The next problem comes with the post-genion grompp, which can’t find ion information…

Modify ions.itp

Similar to the spc.itp error, the error that comes up with the inclusion of counterions confounds the mind because everything seems to be in place.

Program grompp_amber, VERSION 3.3.3
Source code file: toppush.c, line: 1396

Fatal error:
No such moleculetype Na

With Na being whatever counterion you’re trying. The AMBER-on-GROMACS website reports the following for AMBER ion inclusion:

Our AMBER ports include common ion definitions, which are listed in the ffamber*.rtp files (just below the TIP water models). This allows the AMBER ports to be used without modification or use of the GROMACS ions.itp file. At the moment these include Cl- , IB+, Na+, K+ , Rb+, Cs+, Li+ , Ca2+, Mg2+, Zn2+, Sr2+, and Ba2+. If your pdb file has ions present and pdb2gmx does not properly convert those ions, please check the atom and residue name of your ions and rename them if necessary to agree with the .rtp file. If you are using ion-related GROMACS tools, such as genion, you will need to enter the AMBER ion definition to the ions.itp file in the “top” directory of the GROMACS distribution.

The bases for the ion use are in the .rtp files, but the implementation, at least for GROMACS 3.3.3 and possibly earlier versions, is not as found in these files.

The proper format for both the FFAMBER_94 and FFAMBER_99 ion types in ions.itp is as follows:


#ifdef _FF_AMBER94

[ moleculetype ]
; molname       nrexcl
Na              1
[ atoms ]

; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber94_31      1       Na              Na       1      1         22.99000
#endif

#ifdef _FF_AMBER99

[ moleculetype ]
; molname       nrexcl
Na              1
[ atoms ]

; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber99_31      1       Na              Na       1      1         22.9900
#endif

This is the format used for the FF_GROMOS96 ions with one change. The atom type for the FF_AMBERXX parameters is NOT the atom label, but instead the AMBER force field label. In the case of Na, this is amber94_31 (for AMBER94) and amber99_31 (for AMBER99). Note that the mass must be specified (you have to scroll down the ions.itp file to see FF_GROMOS96. FF_GROMACS does not require mass specification).

For quick reference, here are the following [ atoms ] specifications for FF_AMBER94 and FF_AMBER_99.

#ifdef _FF_AMBER94
; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber94_32      1       IB              IB       1      1         131.00000
1       amber94_56      1       Li              Li       1      1         6.94000
1       amber94_31      1       Na              Na       1      1         22.99000
1       amber94_51      1       K               K        1      1         39.10000
1       amber94_52      1       Rb              Rb       1      1         85.47000
1       amber94_53      1       Cs              Cs       1      1         132.90000
1       amber94_33      1       Mg              Mg       1      2         24.30500
1       amber94_15      1       Ca              Ca       1      2         40.08000
1       amber94_57      1       Zn              Zn       1      2         65.40000
1       amber94_58      1       Sr              Sr       1      2         87.62000
1       amber94_59      1       Ba              Ba       1      2         137.33000
1       amber94_30      1       Cl              Cl       1      -1        35.45000
#endif

#ifdef _FF_AMBER99
; id    at type         res nr  residu name     at name  cgnr   charge    mass
1       amber99_32      1       IB              IB       1      1         131.00000
1       amber99_56      1       Li              Li       1      1         6.94000
1       amber99_31      1       Na              Na       1      1         22.99000
1       amber99_51      1       K               K        1      1         39.10000
1       amber99_52      1       Rb              Rb       1      1         85.47000
1       amber99_53      1       Cs              Cs       1      1         132.90000
1       amber99_33      1       Mg              Mg       1      2         24.30500
1       amber99_15      1       Ca              Ca       1      2         40.08000
1       amber99_57      1       Zn              Zn       1      2         65.40000
1       amber99_58      1       Sr              Sr       1      2         87.62000
1       amber99_59      1       Ba              Ba       1      2         137.33000
1       amber99_30      1       Cl              Cl       1      -1        35.45000
#endif

To save yourself plenty of trouble, download the ions.itp file with all of the ion parameters in the form of the following link:

Download amber_ions.txt, delete “amber_”, change “.txt” to “.itp”, place in /ULG-A/top

With the ions.itp file complete, your GROMACS energy minimizations and dynamics simulations of amino acid and nucleic acid structures should go without hitch.

My thanks to Alan Wilter S. da Silva, D.Sc. – CCPN Research Associate, Department of Biochemistry, University of Cambridge, for catching a formatting error in the first version of the amber_ions.itp file.

If you find problems, questions, concerns, incompatibilities, etc., please let me know by setting up a user account and posting a comment in this post or email me so I can post whatever you might find.

And don’t forget to cite ffAMBER if you use it!

Sorin & Pande (2005). Biophys. J. 88(4), 2472-2493

chemistry.csulb.edu/ffamber
www.gromacs.org
chemistry.csulb.edu/esorin
chemistry.csulb.edu
amber.scripps.edu
www.nanorex.com
en.wikipedia.org/wiki/DNA_nanotechnology
www.somewhereville.com/rescv/fnano08_2008_poster.jpg
www.cs.duke.edu/~reif/FNANO
www.ks.uiuc.edu/Research/namd
en.wikipedia.org/wiki/Open_source
folding.stanford.edu
qutemol.sourceforge.net
www.pdb.org
www.pdb.org/pdb/explore/explore.do?structureId=1BNA
www.linux.org
www.apple.com/macosx
www.gromacs.org/documentation/reference/online/pdb2gmx.html

Compiling Single-Precision And Double-Precision GROMACS 3.3.3 With OpenMPI 1.2.6 Under OSX 10.5 (Leopard)

The following is a cookbook for compiling single-precision and double-precision GROMACS 3.3.3 in OSX 10.5 (specifically on a MacBook Pro, but most likely general to all things running 10.5) with OpenMPI 1.2.6. My hope is that this saves someone several hours of unnecessary work trying to overcome an otherwise unknown incompatibility between MPICH2 and GROMACS 3.3.3 in Leopard (10.5).

The content of this page is a result of an unsuccessful several hours of trying to build GROMACS-MPI versions with MPICH2 1.0.6 and 1.0.7. MPICH2 compiles just fine with standard options, including a successful testing of mpd and mpdtrace. GROMACS 3.3.3 compiles just fine with standard options for both single-precision and double-precision. Compiling GROMACS with MPI support yields an mdrun file that fails in the following manner:

[host:XXXX1] *** Process received signal ***
[host:XXXX1] Signal: Segmentation fault (11)
[host:XXXX1] Signal code: Address not mapped (1)
[host:XXXX1] Failing at address: 0xffffff94
[ 1] [0x00000000, 0xffffff94] (FP-)
[host:XXXX2] *** Process received signal ***
[host:XXXX2] Signal: Bus error (10)
[host:XXXX2] Signal code: (2)
[host:XXXX2] Failing at address: 0x2
[host:XXXX1] *** End of error message ***
[ 1] [0x00000000, 0x00000002] (FP-)
[marlin:XXXX2] *** End of error message ***

This problem, it has been discovered, is remedied by using OpenMPI 1.2.6. Not a proper diagnosis of the MPICH2/GROMACS problem, but my primary concern is getting MPI working in order to use both cores on my MacBook Pro to get calculations running, not fixing software bugs to get someone else’s calculations running (when there’s an easier fix, anyway).

Installation Procedure

You’ll need the following three files (relevant versions and links are subject to change!):

fftw-3.1.2, http://www.fftw.org/

According to the website:

FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).

FFTW compiles double-precision libraries by default. You’ll need to build single-precision libraries for the single-precision GROMACS install.

gromacs-3.3.3, http://www.gromacs.org/

The newest version. Compilation of version 3.3.2 leads to various problems under OSX 10.5 (undiagnosed here, but certainly reproducible).

openmpi-1.2.6, http://www.open-mpi.org/

This is the MPICH2 replacement (meaning I’ve used MPICH2 for other programs). Again, I’m not playing favorites on a version-to-version level. On my MacBook Pro running OSX 10.5, OpenMPI does what I need, MPICH2 doesn’t.

GROMACS uses MPI to distribute processes between processors. If you don’t have GROMACS compiled with MPI, you don’t have multi-processor calculations (simple enough). That is to say, the Activity Monitor reads 100% for one processor and residual % for all other processes on the other chip (this was a point of confusion in a few discussions, in case someone wonders why I would bother bringing such a point up).

Associated Notes On Compilation

A few important notes to be aware of for the compilation.

XCode 3.0, http://developer.apple.com/tools/xcode/

If you’ve not installed XCode 3.0 yet, you should in order to get compilers and libraries installed on your machine. XCode is the official programmer’s toolbox under OSX and installs far more than you’ll need (but it never hurts). Note that this is a BIG download (1.1 GB) but is a far less taxing route to getting all of the necessary files installed on your machine than relying on (many, many) individual downloads.

Root Access

Running “make install” will install files into core directories that are inaccessible to typical OSX User accounts. Access to these directories (such as /usr/local and /usr/local/lib) is granted only to the root user in OSX, which is not activated by default (and a good thing, too). To turn on root access, go to:

Macintosh HD > Applications > Utilities > Directory Utility

In Directory Utility, go to

Edit > Enable Root User

At build time, you’ll want to be logged in as the root user (see below).

No Spaces In Folder Names

This goof also took some time to figure out. Regardless of where you start the program build processes from, you need to make sure your directory names have no spaces between words.

>& FILENAME.txt

>& FILENAME.txt is used to direct output to FILENAME.txt, providing a way to follow each step in the process for error checking and the like. For diagnosis purposes, the files from my build are provided here for the GROMACS work. Click on each name to open the log file.

Installation Process

How to follow the text below:

1. Step in the process (one per program, significant activity)

1a. Text that follows the numeric-alphabetical label is what needs to be typed in at the Terminal window prompt. Descriptive/explanatory text follows below each step.

The installation is assumed to be set up as follows: the GROMACS, OpenMPI, and FFTW .tar files (I suspect downloading will automatically unzip them) exist in a directory on your Desktop (say, INSTALL_DIRECTORY_NAME). Here’s the compilation procedure:

1. Open a Terminal (Macintosh HD > Applications > Utilities > Terminal). If you don’t have this application on your Dock, I recommend putting it there. You’ll certainly be getting some use out of it.

2. The Terminal window defaults to your User directory. First we change our user to root (for full access), then cd into the install directory.

2a. su

(put in root password at prompt)

at prompt, type:

2b. csh
2c. cd Desktop/INSTALL_DIRECTORY_NAME

3. untar the GROMACS, OpenMPI, and FFTW .tar downloads (again, I suspect they will have already been unzipped as part of the download). You’ll end up with three new directories in this folder.

3a. tar -xvf fftw-3.1.2.tar
3b. tar -xvf gromacs-3.3.3.tar
3c. tar -xvf openmpi-1.2.6.tar

4. Build FFTW

We’ll compile fftw-3.1.2 first. For the single-precision build, the steps are:

4a. cd fftw-3.1.2
4b. ./configure --enable-float --enable-threads >& configure_fftw_single.txt
4c. make >& make_fftw_single.txt
4d. make install >& make_install_fftw_single.txt
4e. make distclean >& make_distclean_fftw_single.txt
4f. cd ..

This series of steps configures (configure), builds (make), moves (install) and cleans up (distclean). The “>&” directs output to the .txt files for diagnosis (all of which you can leave off). To follow step progress, open a new Terminal window, get to the directory of interest and type:

4g. tail -f FILENAME_OF_INTEREST.txt

To build the double-precision version (FFTW default and what you’re better off building anyway)

4h. cd fftw-3.1.2
4i. ./configure --enable-threads >& configure_fftw_double.txt
4j. make >& make_fftw_double.txt
4k. make install >& install_fftw_double.txt
4l. make distclean >& distclean_fftw_double.txt
4m. cd ..

5. Build OpenMPI

This build could not be easier. This build will place the OpenMPI 1.2.6 executables into /usr/local/openmpi (in the interest of organization).

5a. cd openmpi-1.2.6
5b. ./configure --prefix=/usr/local/openmpi >& configure_openmpi.txt
5c. make >& make_openmpi.txt
5d. make install >& install_openmpi.txt
5e. make distclean >& distclean_openmpi.txt
5f. cd ..

6. Build GROMACS

The following four builds will yield all four possible combinations of GROMACS (single-precision and double-precision) and MPI (without and with). Do you need four builds of GROMACS? Definitely not. If you’re reading this page, you’re probably interested only in double-precision and MPI (the last of the four). The four builds listed below were performed for testing purposes only. I only ever use the double-precision MPI version when I’m doing my own work.

Note: Each build included the generation of links to executables that go into /usr/local/bin. Accordingly, all four versions are accessible from the Terminal window without having to specify directories (and each version has individually named files as defined in –program-suffix= ).

GROMACS Single-Precision

This will install a single-precision GROMACS build into /usr/local/gromacs333_single with no specific file suffix.

6a. cd gromacs-3.3.3
6b. ./configure --prefix=/usr/local/gromacs333_single >& gromacs_single_configure.txt
6c. make >& gromacs_single_make.txt
6d. make install >& gromacs_single_install.txt
6e. make links >& gromacs_single_links.txt
6f. make distclean >& gromacs_single_distclean.txt
6g. cd ..

GROMACS Single-Precision With OpenMPI

This will install a single-precision MPI-GROMACS build into /usr/local/gromacs333_single_mpi with the file suffix _mpi.

6h. cd gromacs-3.3.3
6i. ./configure --enable-mpi --program-suffix=_mpi --prefix=/usr/local/gromacs333_single_mpi
>& gromacs_single_mpi_configure.txt
6j. make >& gromacs_single_mpi_make.txt
6k. make install >& gromacs_single_mpi_install.txt
6l. make links >& gromacs_single_mpi_links.txt
6m. make distclean >& gromacs_single_mpi_distclean.txt
6n. cd ..

GROMACS Double-Precision

This will install a double-precision GROMACS build into /usr/local/gromacs333_double with the file suffix _d.

6o. cd gromacs-3.3.3
6p. ./configure --program-suffix=_d --prefix=/usr/local/gromacs333_double --enable-double
>& gromacs_double_configure.txt
6q. make >& gromacs_double_make.txt
6r. make install >& gromacs_double_install.txt
6s. make links >& gromacs_double_links.txt
6t. make distclean >& gromacs_double_distclean.txt
6u. cd ..

GROMACS Double-Precision With OpenMPI

This will install a double-precision MPI-GROMACS build into /usr/local/gromacs333_double_mpi with the file suffix _mpi_d.

6v. cd gromacs-3.3.3
6w. ./configure --enable-mpi --program-suffix=_mpi_d --prefix=/usr/local/gromacs333_double_mpi
--enable-double >& gromacs_double_mpi_configure.txt
6x. make >& gromacs_double_mpi_make.txt
6y. make install >& gromacs_double_mpi_install.txt
6z. make links >& gromacs_double_mpi_links.txt
6aa. make distclean >& gromacs_double_distclean_mpi.txt
6ab. cd ..

Running MPI-GROMACS Calculations (Non-specific)

Running MPI-GROMACS is straightforward, requiring only one additional step and a few changes to how you use grompp and mdrun.

a. mpd &
b. grompp_mpi_d -np 2

-np 2 is added to tell grompp that two processors are being used. mdrun expects the same number of processors as was specified in grompp.

c. mpirun -np 2 /usr/local/gromacs333_double_mpi/bin/mdrun_mpi_d -np 2

mpirun first calls the number of processors to use (-np 2) and then requires specification of the path to the mdrun executable (/usr/local/gromacs333_double_mpi). mdrun requires specifying the number of processors as well (-np 2) as per the specification in grompp.

And Finally…

Like all first draft cookbooks, this might be missing some important spices. If, by any chance, you found this page and have recommendations to improve speed, stability, organization, etc., please drop a line and I’ll keep track of modifications.

en.wikipedia.org/wiki/Single_precision
en.wikipedia.org/wiki/Double_precision
www.gromacs.org
www.apple.com/macosx/
en.wikipedia.org/wiki/Mac_OS_X_v10.5
www.apple.com/macbookpro/
www.open-mpi.org/
www.mcs.anl.gov/research/projects/mpich2/
www.gromacs.org/documentation/reference/online/mdrun.html
www-unix.mcs.anl.gov/mpi/
www.fftw.org
en.wikipedia.org/wiki/Activity_monitor
developer.apple.com/tools/xcode/
en.wikipedia.org/wiki/NetInfo_Manager
en.wikipedia.org/wiki/Terminal_(application)
en.wikipedia.org/wiki/Dock_(computing)
en.wikipedia.org/wiki/Tar_file
www.gromacs.org/documentation/reference/online/grompp.html