-
Notifications
You must be signed in to change notification settings - Fork 10
/
NOTES-developer
282 lines (199 loc) · 9.68 KB
/
NOTES-developer
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
INDEX of notes to help remember how to information:
NOTE 1: Here are commands to help in examining the
NOTE 2: How to create an Open|SpeedShop patch
NOTE 3: TEST FOR FILE LOCKING TO SEE IF SQLITE CAN CREATE A DATABASE FILE
NOTE 4: HOW TO BOOTSTRAP:
NOTE 5: HOW TO BUILD CBTF INSTRUMENTOR VERSION: (example configure)
NOTE 6: HOW to cvs tag the release: (11-15-13 jeg)
NOTE 7: Finding undefined symbols in openss
NOTE 8: Finding if library is compiled without -fPIC
NOTE 9: cluster analysis in the CLI:
NOTE 10: Using valgrind for finding memory bugs:
NOTE 11: fPIC determination:
NOTE 12: Getting the devel branches for the new gui and spack:
NOTE 13: You can obtain the newest version of config.guess and config.sub
NOTE 14: Finding the format of a binary/executable:
NOTE 15: Technique to see the source from the cli.
NOTE 16: spack build from a file.
NOTE 17: TBD
NOTE 1: Here are commands to help in examining the
openspeedshop database file with sqlite:
sqlite3 name of openss data file
sqlite3 prompt: .schema (shows layout of database)
select name from functions; (shows all function symbols)
select count(*) from data; (should be > 0 for valid data)
select path from files; (shows all files in database)
select pid from threads;
select mpi_rank from threads;
select posix_tid from threads;
select host from threads;
select command from threads;
# accessing counts inside a table
select view_cmd from Views;
select view_data from Views;
select view_data from Views WHERE view_cmd = "expview"
sqlite> select count (view_data) from Views;
0
sqlite> select count (view_cmd) from Views;
1
# get index information about table entries
sqlite> PRAGMA INDEX_LIST('table_name');
Returns a table with 3 columns:
seq Unique numeric ID of index
name Name of the index
unique Uniqueness flag (nonzero if UNIQUE index.)
sqlite> PRAGMA INDEX_LIST('VectorInstrs');
0|IndexVectorInstrsByLinkedObject|0|c|0
sqlite> PRAGMA INDEX_LIST('Loops');
0|IndexLoopsByLinkedObject|0|c|0
# get version of database
SELECT version FROM "Open|SpeedShop";
an so on an so forth...
# The order here corresponds to the thread list (example -np4 mpi job)
sqlite> select pid from threads;
2159 (thread 1) mpirun
2188 (thread 2)
2186 (thread 3)
2185 (thread 4)
2187 (thread 5)
# Five blobs were sent
select count(*) from data;
5
NOTE 2: How to create an Open|SpeedShop patch
at the top-level directory do this command:
cvs diff -uN > myOSS.patch
How to use the patch
at the top-level directory do this command:
patch -p0 < myOSS.patch
NOTE 3: TEST FOR FILE LOCKING TO SEE IF SQLITE CAN CREATE A DATABASE FILE
cd <directory in file system being checked>
sqlite3 junkfile
create table JUNK (version integer);
insert into JUNK (version) values(1);
cntl-D
NOTE 4: HOW TO BOOTSTRAP:
If autotools not built then cd OpenSpeedShop_ROOT
export OPENSS_AUTOTOOLS_ROOT=<autotools_path>
./install.sh --devel
# adjust module for autotools
module load autotools-2.2.6b
./bootstrap
module unload autotools-2.2.6b
NOTE 5: HOW TO BUILD CBTF INSTRUMENTOR VERSION: (example configure)
# shows where the expected components could/should come from (root, boost, cbtf are main categories)
./configure --prefix=/users/jeg/todi/cbtf_oss --with-instrumentor=cbtf --enable-resolve-symbols=symtabapi --with-symtabapi=/users/jeg/todi/krell_root --with-mrnet=/users/jeg/todi/krell_root --with-mrnet-version=4.0.0 --with-dyninst=/users/jeg/todi/krell_root --with-dyninst-version=8.0.0 --with-libdwarf=/users/jeg/todi/krell_root --with-libmonitor=/users/jeg/todi/krell_root --with-libxerces-c-prefix=/users/jeg/todi/krell_root --with-cbtf=/users/jeg/todi/cbtf_proper_shared --with-cbtf-xml=/users/jeg/todi/cbtf_proper_shared --with-cbtf-mrnet=/users/jeg/todi/cbtf_proper_shared --with-cbtf-messages=/users/jeg/todi/cbtf_proper_shared --with-cbtf-services=/users/jeg/todi/cbtf_proper_shared --with-boost=/apps/todi/boost/1.50sn/gnu_434 --with-boost-libdir=/apps/todi/boost/1.50sn/gnu_434/lib --with-sqlite=/users/jeg/todi/krell_root
NOTE 6: HOW to cvs tag the release: (11-15-13 jeg)
cvs tag openspeedshop_21
NOTE 7: Finding undefined symbols in openss
export LD_DEBUG=libs
openss -cli
strace openss -cli
NOTE 8: Finding if library is compiled without -fPIC
> for i in /usr/lib/*.a /usr/local/lib/*.a; do
> objdump --reloc $i 2>/dev/null | grep R_X86_64_32S > /dev/null && echo $i;
> done
>
objdump --reloc <library name> 2>/dev/null | grep R_X86_64_32S > /dev/null
like:
objdump --reloc /usr/lib64/libiberty.a 2>/dev/null | grep R_X86_64_32S > /dev/null
NOTE 9: cluster analysis in the CLI:
openss>>cviewcluster # optionally add: -vlinkedobjects or other qualifiers
2
3
openss>>cview -c 2,3 -mthreadaverage
NOTE 10: Using valgrind for finding memory bugs:
valgrind --trace-children=yes --log-file=mylog.txt --tool=memcheck --leak-check=yes openss -cli -f smg2000-usertime-1.openss
NOTE 11: fPIC determination:
jeg@jeg-OptiPlex-GX620:~/OpenSpeedShop_ROOT$ objdump --reloc /usr/lib/libiberty_pic.a 2>/dev/null | grep R_X86_64_32S
jeg@jeg-OptiPlex-GX620:~/OpenSpeedShop_ROOT$ objdump --reloc /usr/lib/libiberty.a 2>/dev/null | grep R_X86_64_32S
00000000000000f5 R_X86_64_32S .rodata
00000000000004b4 R_X86_64_32S .rodata+0x00000000000000f0
000000000000071a R_X86_64_32S .bss+0x0000000000000080
000000000000074f R_X86_64_32S .bss+0x0000000000000080
NOTE 12: Getting the devel branches for the new gui and spack:
a) PTGF related GUI source git devel branch checkout information
git clone https://github.com/PTGF/PTGF ptgf
pushd ptgf
git checkout --track -b devel origin/devel
git pull
popd
git clone https://github.com/PTGF/QCustomPlot qcustomplot
pushd qcustomplot
git checkout --track -b devel origin/devel
popd
git clone https://github.com/OpenSpeedShop/gui openss
pushd openss
git checkout --track -b devel origin/devel
popd
b) SPACK - devel branch
git clone https://github.com/scalability-llnl/spack.git
git checkout -t origin/develop
c) Test for the active branch
git branch -a
NOTE 13: You can obtain the newest version of config.guess and config.sub
from the ‘config’ project at http://savannah.gnu.org/. The commands to fetch them are
$ wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
$ wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
NOTE 14: Finding the format of a binary/executable:
bint01 448% objdump -af nbody.mic2
nbody.mic2: file format elf64-little
nbody.mic2
architecture: UNKNOWN!, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000401310
NOTE 15: Technique to see the source from the cli.
a) 1 line: !sed -n line#p filename
b) range of lines for context: !sed -n begin#,end# filename
Here is a single line example:
openss>>!sed -n 2356p lulesh.cc
Here is a multiple line example:
openss>>!sed -n 2350,2355p lulesh.cc
{
// Bound the updated relative volumes with eosvmin/max
if (eosvmin != Real_t(0.)) {
#pragma omp for firstprivate(numElem)
for(Index_t i=0 ; i<numElem ; ++i) {
if (vnew[i] < eosvmin)
NOTE 16: Spack build from a file
# Optional mirror template
url = "file:/home/jeg/openspeedshop-develop.tar.gz"
version('develop', '517a7798507241ad8abd8b0626a4d2cf')
NOTE 17: Installing GCC the C compiler on Ubuntu 20.04 step by step instructions
Install multiple C and C++ compiler versions:
$ sudo apt install build-essential
$ sudo apt -y install gcc-7 g++-7 gcc-8 g++-8 gcc-9 g++-9
SUBSCRIBE TO NEWSLETTER
Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.
Use the update-alternatives tool to create list of multiple GCC and G++ compiler alternatives:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
Check the available C and C++ compilers list on your Ubuntu 20.04 system and select desired version by entering relevant selection number:
$ sudo update-alternatives --config gcc
There are 3 choices for the alternative gcc (providing /usr/bin/gcc).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/gcc-9 9 auto mode
1 /usr/bin/gcc-7 7 manual mode
* 2 /usr/bin/gcc-8 8 manual mode
3 /usr/bin/gcc-9 9 manual mode
Press to keep the current choice[*], or type selection number:
For C++ compiler execute:
$ sudo update-alternatives --config g++
There are 3 choices for the alternative g++ (providing /usr/bin/g++).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/g++-9 9 auto mode
1 /usr/bin/g++-7 7 manual mode
2 /usr/bin/g++-8 8 manual mode
3 /usr/bin/g++-9 9 manual mode
Press to keep the current choice[*], or type selection number:
Each time after switch check your currently selected compiler version:
$ gcc --version
$ g++ --version
NOTE 18: Get rid of PackageKit cache file storage on Fedora
https://anglehit.com/how-to-clean-up-packagekit-in-fedora-os-the-right-way/
> pkcon refresh force