Difference between revisions of "NAMD"

From Tau Wiki
Jump to: navigation, search
(Guide to building and running NAMD 2.6 with TAU)
(Guide to building and running NAMD 2.6 with TAU)
Line 1: Line 1:
 
= Guide to building and running NAMD 2.6 with TAU =
 
= Guide to building and running NAMD 2.6 with TAU =
Current this guide is for build NAMD and charm++ from source on x86 64-bit architecture. One would follow similar step on other machines but we have experienced additional difficulties.  
+
Currently this guide is for building NAMD and charm++ from source on x86 64-bit architecture. One would follow similar step on other machines but we have experienced additional difficulties.  
 +
 
 +
==Manual Instrumentation==
 +
Because NAMD uses charm++ threading library with need to manual instrument some portion of NAMD and charm++ to let TAU know when threads are being create, etc. You should be able to apply this patch to NAMD to insert the instrumentation:
 +
<pre>
 +
%> tar xzf NAMD_2.6_Source.tar.gz
 +
%> cd NAMD_2.6_Source
 +
%> tar xf charm-5.9.tar
 +
%> patch -R -p0 < NAMD2.6-TAU.patch
 +
</pre>
  
 
==Building Charm++==
 
==Building Charm++==
Line 6: Line 15:
 
After downloading '''NAMD_2.6_Source.tar.gz''' do the following:
 
After downloading '''NAMD_2.6_Source.tar.gz''' do the following:
 
<pre>
 
<pre>
%> tar xzf NAMD_2.6_Source.tar.gz
+
%> cd NAMD_2.6_Source/charm-5.9
%> cd NAMD_2.6_Source
 
%> tar xf charm-5.9.tar
 
%> cd charm-5.9
 
 
%> ./build charm++ net-linux-amd64
 
%> ./build charm++ net-linux-amd64
 
</pre>
 
</pre>
Line 19: Line 25:
 
%> ./charmrun ++local ./hello
 
%> ./charmrun ++local ./hello
 
</pre>
 
</pre>
Verify that this program running with any error before continuing.
+
Verify that this program runs without any errors before continuing.
  
 
==Building TAU==
 
==Building TAU==
Line 38: Line 44:
 
Verify that profile files have been generated in this directory.
 
Verify that profile files have been generated in this directory.
  
==Building NAMD 2.6==
+
 
There are several patches that need to be applied before can run NAMD with TAU instrumentation but we will put those aside for now to concentrate on building NAMD with TAU auto-instrumentation.
+
 
 +
==Preparing NAMD 2.6==
  
 
1. First edit Make.charm in NAMD's home so that CHARMBASE is set to the directory where charm-5.9 resides.
 
1. First edit Make.charm in NAMD's home so that CHARMBASE is set to the directory where charm-5.9 resides.
Line 63: Line 70:
 
And save this file in the NAMD home directory.
 
And save this file in the NAMD home directory.
  
3. Furthermore edit arch/Linux-amd64-g++.arch so that it resembles:
+
3. lastly edit arch/Linux-amd64-g++.arch so that it resembles:
 
<pre>
 
<pre>
 
include /share/home/00968/tg802155/tau2/include/Makefile
 
include /share/home/00968/tg802155/tau2/include/Makefile
Line 76: Line 83:
 
COPTS = -O3 -m64 -fexpensive-optimizations -ffast-math
 
COPTS = -O3 -m64 -fexpensive-optimizations -ffast-math
 
</pre>
 
</pre>
 +
 +
==Building NAMD 2.6==
  
 
Begin in NAMD's home directory:
 
Begin in NAMD's home directory:
Line 107: Line 116:
 
</pre>
 
</pre>
  
If everything works properly you should now have a '''namd2''' executable.
+
If everything works properly you should now have a '''namd2''' executable. Test by running:
 +
<pre>
 +
%> ./charmrun ++local ./namd2 src/alanin
 +
</pre>
 +
You should have a generated performance file profile.0.0.0.

Revision as of 00:59, 18 June 2008

Guide to building and running NAMD 2.6 with TAU

Currently this guide is for building NAMD and charm++ from source on x86 64-bit architecture. One would follow similar step on other machines but we have experienced additional difficulties.

Manual Instrumentation

Because NAMD uses charm++ threading library with need to manual instrument some portion of NAMD and charm++ to let TAU know when threads are being create, etc. You should be able to apply this patch to NAMD to insert the instrumentation:

%> tar xzf NAMD_2.6_Source.tar.gz
%> cd NAMD_2.6_Source
%> tar xf charm-5.9.tar
%> patch -R -p0 < NAMD2.6-TAU.patch

Building Charm++

After downloading NAMD_2.6_Source.tar.gz do the following:

%> cd NAMD_2.6_Source/charm-5.9
%> ./build charm++ net-linux-amd64

Wait for charm to finish building then test the configuration by:

%> cd net-linux-amd64/tests/charm++/simplearrayhello
%> make
%> ./hello
%> ./charmrun ++local ./hello

Verify that this program runs without any errors before continuing.

Building TAU

Make sure to have the latest version of TAU installed on your system. To configure TAU to work with charm++ do the following:

%> cd tau2
%> ./configure -pdt=<path to pdt> -charm=<path to the NAMD_2.6_Source/charm-5.9>
...
%> make clean install

To confirm TAU is working properly with charm++ try running this example program:

%> cd examples/charm
%> export PATH=<path to NAMD/charm-5.9/bin>
%> make
%> ./charmrun ++local ./pgm

Verify that profile files have been generated in this directory.


Preparing NAMD 2.6

1. First edit Make.charm in NAMD's home so that CHARMBASE is set to the directory where charm-5.9 resides. 2. Next create a selective instrumentation file with these commands:

BEGIN_EXCLUDE_LIST
void Sequencer::thread#
void Controller::thread#
int NAMD_read_int#
void PDBDATA::scan#
Real PDBAtom::zcoor#
Real PDBAtom::ycoor#
Real PDBAtom::xcoor#
Bool Molocule::is_hydrogen#
END_EXCLUDE_LIST

BEGIN_FILE_EXCLUDE_LIST
*mainfunc.C
*memusage.C
*BackEnd.C
END_FILE_EXCLUDE_LIST

And save this file in the NAMD home directory.

3. lastly edit arch/Linux-amd64-g++.arch so that it resembles:

include /share/home/00968/tg802155/tau2/include/Makefile
NAMD_ARCH = Linux-amd64
CHARMARCH = net-linux-amd64

TAU_SELECT_FILE=/share/home/00968/tg802155/NAMD_2.6_Source/select.tau

CXX = $(TAU_COMPILER) -optTauSelectFile=$(TAU_SELECT_FILE) g++
CXXOPTS = -O3 -m64 -fexpensive-optimizations -ffast-math
CC = $(TAU_COMPILER) -optTauSelectFile=$(TAU_SELECT_FILE) gcc
COPTS = -O3 -m64 -fexpensive-optimizations -ffast-math

Building NAMD 2.6

Begin in NAMD's home directory:

%> cd NAMD_2.6_Source
%> ./config Linux-amd64-g++
%> cd Linux-amd64-g++


Make one final modification to the Makefile in Linux-amd64-g++ directory, find this line:

namd2:  $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS)
  $(MAKEBUILDINFO)
  $(CHARMC) -verbose -ld++-option \
  "$(COPTI)$(CHARMINC) $(COPTI)$(INCDIR) $(COPTI)$(SRCDIR) $(CXXOPTS)" \
  -module NeighborLB -module commlib -language charm++ \

change the file to be:

namd2:  $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS)
  $(MAKEBUILDINFO)
  $(CHARMC) -L$(TAU_LIB_DIR) -ltau$(TAU_CONFIG) -verbose -ld++-option \
  "$(COPTI)$(CHARMINC) $(COPTI)$(INCDIR) $(COPTI)$(SRCDIR) $(CXXOPTS)" \
  -module NeighborLB -module commlib -language charm++ \

Now run:

%> make

If everything works properly you should now have a namd2 executable. Test by running:

%> ./charmrun ++local ./namd2 src/alanin

You should have a generated performance file profile.0.0.0.