forked from abdulbudiaji/anuga-cuda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.html
310 lines (270 loc) · 7.7 KB
/
readme.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<style>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px solid #ddd;
padding: 3px 10px;
}
th {
padding: 5px 10px;
}
a {
color: #0069d6;
}
a:hover {
color: #0050a3;
text-decoration: none;
}
a img {
border: none;
}
p {
margin-bottom: 9px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #404040;
line-height: 36px;
}
h1 {
margin-bottom: 18px;
font-size: 30px;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px;
}
h6 {
font-size: 13px;
}
hr {
margin: 0 0 19px;
border: 0;
border-bottom: 1px solid #ccc;
}
blockquote {
padding: 13px 13px 21px 15px;
margin-bottom: 18px;
font-family:georgia,serif;
font-style: italic;
}
blockquote:before {
content:"\201C";
font-size:40px;
margin-left:-10px;
font-family:georgia,serif;
color:#eee;
}
blockquote p {
font-size: 14px;
font-weight: 300;
line-height: 18px;
margin-bottom: 0;
font-style: italic;
}
code, pre {
font-family: Monaco, Andale Mono, Courier New, monospace;
}
code {
background-color: #fee9cc;
color: rgba(0, 0, 0, 0.75);
padding: 1px 3px;
font-size: 12px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre {
display: block;
padding: 14px;
margin: 0 0 18px;
line-height: 16px;
font-size: 11px;
border: 1px solid #d9d9d9;
white-space: pre-wrap;
word-wrap: break-word;
}
pre code {
background-color: #fff;
color:#737373;
font-size: 11px;
padding: 0;
}
sup {
font-size: 0.83em;
vertical-align: super;
line-height: 0;
}
* {
-webkit-print-color-adjust: exact;
}
@media screen and (min-width: 914px) {
body {
width: 854px;
margin:10px auto;
}
}
@media print {
body,code,pre code,h1,h2,h3,h4,h5,h6 {
color: black;
}
table, pre {
page-break-inside: avoid;
}
}
</style>
<title>[anuga-cuda](https://code.google.com/p/anuga-cuda/) - the GPU based ANUGA
===========================
Documentation
-------------
Documentation</title>
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax:{inlineMath:[['$$$','$$$']]}});</script><script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
<h1><a href="https://code.google.com/p/anuga-cuda/">anuga-cuda</a> - the GPU based ANUGA </h1>
<h2>Documentation</h2>
<p>Documentation is under doc directory, and the html version generated by <strong>Sphinx</strong> under the directory <em>doc/sphinx/build/html/</em></p>
<h2>Install Guide</h2>
<ol>
<li>Original <a href="anuga.anu.edu.au">ANUGA</a> is required</li>
<li>For CUDA version, <a href="documen.tician.de/pycuda">PyCUDA</a> is required</li>
<li>For OpenHMPP version, current implementation is based on the <a href="www.caps-entreprise.com">CAPS OpenHMPP Compiler</a>
<ul>
<li>When compiling the code with <strong>Makefile</strong>, the NVIDIA device architecture and compute capability need to be specified
<ul>
<li>For example, GTX480 with 2.0 compute capability </br>
<code>HMPP_FLAGS13 = -e --nvcc-options -Xptxas=-v,-arch=sm_20 -c --force</code></li>
<li>For GTX680 with 3.0 compute capability </br>
<code>HMPP_FLAGS13 = -e --nvcc-options -Xptxas=-v,-arch=sm_30 -c --force</code></li>
</ul>
</li>
<li>Also the path for <strong>python</strong>, <strong>numpy</strong>, and <strong>ANUGA/utilities</strong> packages need to be specified</li>
<li>Defining the macro <strong>USING_MIRROR_DATA</strong> in <strong>hmpp_fun.h</strong> </br>
<code>#define USING_MIRROR_DATA</code>
</br>will enable the advanced version, which uses OpenHMPP Mirrored Data technology so that data transmission costs can be effectively cut down, otherwise basic version is enabled.</li>
</ul>
</li>
</ol>
<h2>Environment Vars</h2>
<p>Please add following vars to you <strong>.bashrc</strong> or <strong>.bash_profile</strong> file</p>
<pre><code>export ANUGA_CUDA=/where_the_anuga-cuda/src
export $PYTHONPATH=$PYTHONPATH:$ANUGA_CUDA
</code></pre>
<h2>Basic Code Structure</h2>
<p><img src="docs/codeStructure.pdf" title="anuga-cuda code structure" alt="Code Structure" /></p>
<ul>
<li><strong>README</strong> (What you are reading)</li>
<li><strong>docs/</strong> Documentation directory
<ul>
<li><strong>codeStructure.pdf</strong> The diagram above</li>
<li><strong>Evolve workflow.pdf</strong> The overall workflow of the evolve procedure. This includes all the function dependency and function interfaces, which is helpful to understand the evolve procedure of ANUGA</li>
<li><strong>device_spe/</strong> Some device specifications of our working station</li>
<li><strong>profiling/</strong> Profiling results
<ul>
<li><strong>CUDA/</strong> All the profiling results on CUDA implementation</li>
</ul>
</li>
<li><strong>sphinx/</strong> The <a href="http://sphinx-doc.org/">Sphinx</a> generated documentation
<ul>
<li><strong>source/</strong> The source files for Sphinx based documents</li>
<li><strong>build/</strong> The generated documents
<ul>
<li><strong>html/</strong> HTML version documentation</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><strong>src/</strong> Source code directory
<ul>
<li><strong>anuga_cuda/</strong> The CUDA implementation
<ul>
<li><strong>config.py</strong> Detail configuration for the CUDA implementation, including the path for all the kernel functions, optimal CUDA thread block configuration, etc.</li>
<li><strong>gpu_domain_advanced.py</strong> Python Class for CUDA implementation in advanced version</li>
<li><strong>gpu_domain_basic.py</strong> Python Class for CUDA implementation in basic version</li>
</ul>
</li>
<li><strong>anuga_HMPP/</strong> The OpenHMPP implementation
<ul>
<li><strong>Makefile</strong> The Makefile</li>
<li><strong>hmpp_dimain.py</strong> Python Class for OpenHMPP implementation</li>
<li><strong>hmpp_python_glue.c</strong> The Python/C API to set up communication between Python ANUGA and OpenHMPP.</li>
<li><strong>sw_domain.h</strong> The C Struct type <strong>domain</strong> used in C implementation to access mesh information generated in Python ANUGA</li>
<li><strong>sw_domain_fun.h</strong> Connect C Struct type <strong>domain</strong> to all mesh information</li>
<li><strong>hmpp_fun.h</strong> All function declarations.</li>
<li><strong>evolve.c</strong> The evolve procedure</li>
</ul>
</li>
<li><strong>scripts/</strong> Some useful bash script</li>
<li><strong>utilities/</strong> Utilities for sorting mesh information, checking results, etc.</li>
</ul>
</li>
<li><strong>test/</strong> Testing cases
<ul>
<li><strong>CUDA/</strong> Testing cases for CUDA implementation
<ul>
<li><strong>merimbula/</strong> Merimbula testing case directory
<ul>
<li><strong>merimbula.py</strong> Merimbula testing case</li>
</ul>
</li>
</ul>
</li>
<li><strong>OpenHMPP/</strong> Testing cases for OpenHMPP implementation
<ul>
<li><strong>merimbula.py</strong> Merimbula testing case</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>Examples</h2>
<p>Running Merimbula model with CUDA implementation.</p>
<p><code>$ python merimbula.py -gpu</code></p>
<p>With pair-testing.</p>
<p><code>$ python merimbula.py -gpu -test</code></p>
<p>With rearranged mesh information.</p>
<p><code>$ python merimbula.py -gpu -rg</code></p>
<h2>Author</h2>
<p>Mail to <a href="[email protected]">Zhe Weng (John)</a></p>
</body>
</html>