-
Notifications
You must be signed in to change notification settings - Fork 16
/
README.CHARM.html
285 lines (223 loc) · 6.74 KB
/
README.CHARM.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<html>
<h1>Using TAU with charm++</h1>
<h2>(tested with 5.4 release 1)</h2>
<p>Note that when TAU is built with charm++, only charm++ programs can use the
resulting library. Additionally, no TAU calls can be made before the
ConverseInit call.
<p>When using TAU_COMPILER with charm++, the following change must be made to
charm/src/conv-core/converse.h :
<pre>
static __inline__ unsigned long long int rdtsc(void)
{
unsigned long long int x;
#ifdef CMK_IA64
__asm__ __volatile__("mov %0=ar.itc" : "=r"(x) :: "memory");
#else
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
#endif
return x;
}
</pre>
Must be changed to :
<pre>
static __inline__ unsigned long long int rdtsc(void)
{
unsigned long long int x;
<font color=red>#ifndef TAU_CHARM</font>
#ifdef CMK_IA64
__asm__ __volatile__("mov %0=ar.itc" : "=r"(x) :: "memory");
#else
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
#endif
<font color=red>#endif</font>
return x;
}
</pre>
This is due to the EDG front-end parse not parsing the __asm__ directive
properly.
<h2>Using TAU with NAMD</h2>
<h3>For NAMD version 2.6 and above see:
<a href="http://www.nic.uoregon.edu/tau-wiki/Guide:NAMDTAU">Building TAU with
NAMD</a></h3>
<p> this website should have the most up to date information on how to build NAMD
with TAU.</p>
<h3>For NAMD version 2.5 use these instructions:</h3>
Example: To build TAU for NAMD 2.5 (with automatic instrumentation) :
<ol>
<li> Download and install PDT
<pre>
wget http://www.cs.uoregon.edu/research/paracomp/proj/pdtoolkit/Download/pdt_latest.tar.gz
tar xzf pdt_latest.tar.gz
cd pdtoolkit-3.3.1
./configure ; make ; make install
</pre>
<li> Download and install TAU
<pre>
wget http://www.cs.uoregon.edu/research/paracomp/proj/tau/tauprofile/dist/tau_latest.tar.gz
tar xzf tau_latest.tar.gz
cd tau-2.14.3
./configure -pdt=<path to pdt> -charm=<path to charm>
</pre>
Note that TAU can be configure to use various options (-TRACE,
-PROFILECALLPATH, etc) with -PROFILE as the default.<br>
<li> Apply the TAU NAMD 2.5 patch
<pre>
cd NAMD_2.5_Source
patch < path/to/tau/examples/charm/namd-2.5.patch
</pre>
Alternatively see <a href=#manual>the manual patching instructions</a> below.
<li> Make the following changes to arch/Linux-i686-g++.arch (or your .arch file):
<ul>
<li> Add "include <path to tau>/include/Makefile"
<li> Change <pre>"CXX = ..."</pre> to <pre>"CXX = $(TAU_COMPILER) -optTauSelectFile=<path to select.tau> ..."</pre>
<li> Change <pre>"CC = ..."</pre> to <pre>"CC = $(TAU_COMPILER) -optTauSelectFile=<path to select.tau> ..."</pre>
</ul>
For example :
<pre>
<font color=red>include /home/amorris/tau2/include/Makefile</font>
NAMD_ARCH = Linux-i686
CHARMARCH = net-linux
CXX = <font color=red>$(TAU_COMPILER) -optTauSelectFile=/home/amorris/select.tau</font> g++ -DSOCKLEN_T=socklen_t -DNO_STRSTREAM_H
CXXOPTS = -O3 -march=pentiumpro -ffast-math -static
CC = <font color=red>$(TAU_COMPILER) -optTauSelectFile=/home/amorris/select.tau</font> gcc
COPTS = -O3 -march=pentiumpro -ffast-math -static
</pre>
<li> We recommend that you set the environment variables PROFILEDIR and TRACEDIR
<pre>
export PROFILEDIR=/tmp
export TRACEDIR=/tmp
</pre>
<li> After execution, you should file profile.X.X.X files in your $PROFILEDIR, view these wwith pprof or paraprof
</ol>
<a NAME="manual"><h2>Manual patching instructions</h2></a>
<ol>
<li> Make the above change to converse.h
<li> Create the selective instrumentation file. We have had success using the
following select.tau file :
<pre>
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
</pre>
<li> Make the following changes to Makefile :
<p>Add $(TAU_COMPILER) to the link phase, as shown
<pre>
namd2: $(INCDIR) $(DSTDIR) $(OBJS) $(LIBS)
$(MAKEBUILDINFO)
<font color=red>$(TAU_COMPILER)</font> $(CHARMC) -verbose -ld++-option \
"$(COPTI)$(CHARMINC) $(COPTI)$(INCDIR) $(COPTI)$(SRCDIR) $(CXXOPTS)" \
-module NeighborLB -module commlib -language charm++ \
$(BUILDINFO).o \
$(OBJS) \
$(DPMTALIB) \
$(DPMELIB) \
$(TCLLIB) \
$(FFTLIB) \
$(PLUGINLIB) \
-lm -o namd2
</pre>
<li> Make the following changes to BackEnd.C
<ul>
<li> Add the following to the top of BackEnd.C:
<pre>
<font color=red>#include <TAU.h>
extern "C" void Tau_create_top_level_timer_if_necessary(void);</font>
</pre>
<li> Change BackEnd::init as follows:
<pre>
void BackEnd::init(int argc, char **argv) {
ConverseInit(argc, argv, slave_init, 1, 1); // calls slave_init on others
<font color=red>TAU_PROFILE_SET_NODE(CmiMyPe());
Tau_create_top_level_timer_if_necessary();
TAU_PROFILE("BackEnd::init", "", TAU_DEFAULT);</font>
cpuTime_start = CmiCpuTimer();
wallTime_start = CmiWallTimer();
if ( CmiMyPe() ) {
slave_init(argc, argv); // for procs that call main
<font color=red>TAU_PROFILE_EXIT("Calling ConverseExit()");</font>
ConverseExit(); // should never return
}
all_init(argc, argv);
</pre>
</ul>
<li> Make the following changes to mainfunc.C
<ul>
<li> Add the following to the top of mainfun.C:
<pre>
<font color=red>#include <TAU.h></font>
</pre>
<li> Change main as follows:
<pre>
int main(int argc, char **argv) {
BackEnd::init(argc,argv);
<font color=red>TAU_PROFILE("int main(int, char**) C", " ", TAU_DEFAULT);</font>
ScriptTcl *script = new ScriptTcl;
Node::Object()->setScript(script);
...
<font color=red>TAU_PROFILE_EXIT("main exiting");</font>
BackEnd::exit();
return 0;
}
</pre>
</ul>
<li> Change Controller.C as follows:
<ul>
<li> Add the following to the top of Controller.C:
<pre>
<font color=red>#include <TAU.h></font>
</pre>
<li> Make the following change to ::threadRun
<pre>
void Controller::threadRun(Controller* arg)
{
<font color=red>TAU_REGISTER_THREAD();</font>
arg->algorithm();
}
</pre>
<li> Make the following change to ::terminate
<pre>
void Controller::terminate(void) {
<font color=red>TAU_PROFILE_EXIT("Controller::terminate");</font>
BackEnd::awaken();
CthFree(thread);
CthSuspend();
}
</pre>
</ul>
<li> Change Sequencer.C as follows:
<ul>
<li> Add the following to the top of Sequencer.C:
<pre>
<font color=red>#include <TAU.h></font>
</pre>
<li> Make the following change to ::threadRun
<pre>
void Sequencer::threadRun(Sequencer* arg)
{
<font color=red>TAU_REGISTER_THREAD();</font>
arg->algorithm();
}
</pre>
<li> Make the following change to ::terminate
<pre>
void Sequencer::terminate(void) {
<font color=red>TAU_PROFILE_EXIT("Sequencer::terminate");</font>
CthFree(thread);
CthSuspend();
}
</pre>
</ul>
</ol>
</html>