xcoll 0.6.1__py3-none-any.whl → 0.6.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xcoll might be problematic. Click here for more details.
- xcoll/general.py +1 -1
- {xcoll-0.6.1.dist-info → xcoll-0.6.2.dist-info}/METADATA +5 -4
- xcoll-0.6.2.dist-info/RECORD +61 -0
- {xcoll-0.6.1.dist-info → xcoll-0.6.2.dist-info}/WHEEL +1 -1
- xcoll/__init__.py.orig +0 -26
- xcoll/general.py.orig +0 -20
- xcoll/initial_distribution.py.orig +0 -256
- xcoll/scattering_routines/fluka/flukaio/.git +0 -1
- xcoll/scattering_routines/fluka/flukaio/.gitignore +0 -2
- xcoll/scattering_routines/fluka/flukaio/CMakeLists.txt +0 -18
- xcoll/scattering_routines/fluka/flukaio/ComponentMakefile +0 -192
- xcoll/scattering_routines/fluka/flukaio/Makefile +0 -144
- xcoll/scattering_routines/fluka/flukaio/README +0 -26
- xcoll/scattering_routines/fluka/flukaio/doc/Doxyfile +0 -1551
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.asciidoc +0 -1054
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.epub +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.html +0 -1607
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO.pdf +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__1.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__2.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__3.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__4.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__5.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__6.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/FlukaIO__7.png +0 -0
- xcoll/scattering_routines/fluka/flukaio/doc/Makefile +0 -8
- xcoll/scattering_routines/fluka/flukaio/doc/docbook.xsl +0 -1690
- xcoll/scattering_routines/fluka/flukaio/include/Connection.h +0 -79
- xcoll/scattering_routines/fluka/flukaio/include/FlukaIO.h +0 -58
- xcoll/scattering_routines/fluka/flukaio/include/FlukaIOServer.h +0 -33
- xcoll/scattering_routines/fluka/flukaio/include/FortranFlukaIO.h +0 -277
- xcoll/scattering_routines/fluka/flukaio/include/Message.h +0 -89
- xcoll/scattering_routines/fluka/flukaio/include/ParticleInfo.h +0 -76
- xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
- xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.so +0 -0
- xcoll/scattering_routines/fluka/flukaio/samples/ClientTest.c +0 -156
- xcoll/scattering_routines/fluka/flukaio/samples/ServerTest.c +0 -123
- xcoll/scattering_routines/fluka/flukaio/samples/fclient.f +0 -149
- xcoll/scattering_routines/fluka/flukaio/samples/fserver.f +0 -118
- xcoll/scattering_routines/fluka/flukaio/src/Connection.c +0 -264
- xcoll/scattering_routines/fluka/flukaio/src/Connection.d +0 -69
- xcoll/scattering_routines/fluka/flukaio/src/Connection.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.c +0 -211
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.d +0 -46
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.c +0 -45
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.d +0 -29
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.h +0 -17
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOHandshake.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.c +0 -84
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.d +0 -70
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIOServer_private.h +0 -22
- xcoll/scattering_routines/fluka/flukaio/src/FlukaIO_private.h +0 -16
- xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.c +0 -533
- xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.d +0 -40
- xcoll/scattering_routines/fluka/flukaio/src/FortranFlukaIO.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.c +0 -304
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.d +0 -66
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.h +0 -30
- xcoll/scattering_routines/fluka/flukaio/src/NetIO.o +0 -0
- xcoll/scattering_routines/fluka/flukaio/src/tags +0 -167
- xcoll/scattering_routines/fluka/flukaio/tests/AllTests.cpp +0 -8
- xcoll/scattering_routines/fluka/flukaio/tests/CommonTest.h +0 -10
- xcoll/scattering_routines/fluka/flukaio/tests/ConnectionTest.cpp +0 -99
- xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOServerTest.cpp +0 -104
- xcoll/scattering_routines/fluka/flukaio/tests/FlukaIOTest.cpp +0 -439
- xcoll/scattering_routines/fluka/flukaio/tests/FortranFlukaIOTest.cpp +0 -682
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.c +0 -19
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeConnection.h +0 -16
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.c +0 -74
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIO.h +0 -50
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.c +0 -16
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOHandshake.h +0 -20
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.c +0 -12
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFlukaIOServer.h +0 -18
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeFortranFlukaIO.h +0 -19
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.c +0 -80
- xcoll/scattering_routines/fluka/flukaio/tests/fakes/FakeNetIO.h +0 -35
- xcoll-0.6.1.dist-info/LICENSE +0 -201
- xcoll-0.6.1.dist-info/NOTICE +0 -2
- xcoll-0.6.1.dist-info/RECORD +0 -138
- /LICENSE → /xcoll-0.6.2.dist-info/LICENSE +0 -0
- /NOTICE → /xcoll-0.6.2.dist-info/NOTICE +0 -0
|
@@ -1,1607 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
5
|
-
<meta name="generator" content="AsciiDoc 8.6.8">
|
|
6
|
-
<title>FlukaIO: A library for particle exchange</title>
|
|
7
|
-
<style type="text/css">
|
|
8
|
-
/*
|
|
9
|
-
* AsciiDoc 'volnitsky' theme for xhtml11 and html5 backends.
|
|
10
|
-
* Based on css from http://volnitsky.com, which was in turn based on default
|
|
11
|
-
* theme from AsciiDoc
|
|
12
|
-
*
|
|
13
|
-
* FIXME: The styling is still a bit rough in places.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/* Default font. */
|
|
18
|
-
body {
|
|
19
|
-
font-family: Georgia,"Times New Roman",Times,serif;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Title font. */
|
|
23
|
-
h1, h2, h3, h4, h5, h6,
|
|
24
|
-
div.title, caption.title,
|
|
25
|
-
thead, p.table.header,
|
|
26
|
-
#toctitle,
|
|
27
|
-
#author, #revnumber, #revdate, #revremark,
|
|
28
|
-
#footer {
|
|
29
|
-
font-family: Candara,Arial,sans-serif;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#toc a {
|
|
34
|
-
border-bottom: 1px dotted #999999;
|
|
35
|
-
color: #3A3A4D !important;
|
|
36
|
-
text-decoration: none !important;
|
|
37
|
-
}
|
|
38
|
-
#toc a:hover {
|
|
39
|
-
border-bottom: 1px solid #6D4100;
|
|
40
|
-
color: #6D4100 !important;
|
|
41
|
-
text-decoration: none !important;
|
|
42
|
-
}
|
|
43
|
-
a { color: #666688; text-decoration: none; border-bottom: 1px dotted #666688; }
|
|
44
|
-
a:visited { color: #615FA0; border-bottom: 1px dotted #615FA0; }
|
|
45
|
-
a:hover { color: #6D4100; border-bottom: 1px solid #6D4100; }
|
|
46
|
-
|
|
47
|
-
em {
|
|
48
|
-
font-style: italic;
|
|
49
|
-
color: #444466;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
strong {
|
|
53
|
-
font-weight: bold;
|
|
54
|
-
color: #444466;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
h1, h2, h3, h4, h5, h6 {
|
|
58
|
-
color: #666688;
|
|
59
|
-
margin-bottom: 0.5em;
|
|
60
|
-
line-height: 1.3;
|
|
61
|
-
letter-spacing:+0.15em;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
h1, h2, h3 { border-bottom: 2px solid #ccd; }
|
|
65
|
-
h2 { padding-top: 0.5em; }
|
|
66
|
-
h3 { float: left; }
|
|
67
|
-
h3 + * { clear: left; }
|
|
68
|
-
|
|
69
|
-
div.sectionbody {
|
|
70
|
-
margin-left: 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
hr {
|
|
74
|
-
border: 1px solid #444466;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
p {
|
|
78
|
-
margin-top: 0.5em;
|
|
79
|
-
margin-bottom: 0.5em;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
ul, ol, li > p {
|
|
83
|
-
margin-top: 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
pre {
|
|
87
|
-
padding: 0;
|
|
88
|
-
margin: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#author {
|
|
92
|
-
color: #444466;
|
|
93
|
-
font-weight: bold;
|
|
94
|
-
font-size: 1.1em;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
#footer {
|
|
98
|
-
font-size: small;
|
|
99
|
-
border-top: 2px solid silver;
|
|
100
|
-
padding-top: 0.5em;
|
|
101
|
-
margin-top: 4.0em;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
#footer-text {
|
|
105
|
-
float: left;
|
|
106
|
-
padding-bottom: 0.5em;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
#footer-badges {
|
|
110
|
-
float: right;
|
|
111
|
-
padding-bottom: 0.5em;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
#preamble {
|
|
115
|
-
margin-top: 1.5em;
|
|
116
|
-
margin-bottom: 1.5em;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
|
|
120
|
-
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
|
121
|
-
div.admonitionblock {
|
|
122
|
-
margin-top: 1.5em;
|
|
123
|
-
margin-bottom: 1.5em;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
div.admonitionblock {
|
|
127
|
-
margin-top: 2.5em;
|
|
128
|
-
margin-bottom: 2.5em;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
div.content { /* Block element content. */
|
|
132
|
-
padding: 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* Block element titles. */
|
|
136
|
-
div.title, caption.title {
|
|
137
|
-
color: #444466;
|
|
138
|
-
font-weight: bold;
|
|
139
|
-
text-align: left;
|
|
140
|
-
margin-top: 1.0em;
|
|
141
|
-
margin-bottom: 0.5em;
|
|
142
|
-
}
|
|
143
|
-
div.title + * {
|
|
144
|
-
margin-top: 0;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
td div.title:first-child {
|
|
148
|
-
margin-top: 0.0em;
|
|
149
|
-
}
|
|
150
|
-
div.content div.title:first-child {
|
|
151
|
-
margin-top: 0.0em;
|
|
152
|
-
}
|
|
153
|
-
div.content + div.title {
|
|
154
|
-
margin-top: 0.0em;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
div.sidebarblock > div.content {
|
|
158
|
-
background: #ffffee;
|
|
159
|
-
border: 1px solid silver;
|
|
160
|
-
padding: 0.5em;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
div.listingblock > div.content {
|
|
164
|
-
border: 1px solid silver;
|
|
165
|
-
background: #f4f4f4;
|
|
166
|
-
padding: 0.5em;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
div.quoteblock {
|
|
170
|
-
padding-left: 2.0em;
|
|
171
|
-
margin-right: 10%;
|
|
172
|
-
}
|
|
173
|
-
div.quoteblock > div.attribution {
|
|
174
|
-
padding-top: 0.5em;
|
|
175
|
-
text-align: right;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
div.verseblock {
|
|
179
|
-
padding-left: 2.0em;
|
|
180
|
-
margin-right: 10%;
|
|
181
|
-
}
|
|
182
|
-
div.verseblock > pre.content {
|
|
183
|
-
font-family: inherit;
|
|
184
|
-
}
|
|
185
|
-
div.verseblock > div.attribution {
|
|
186
|
-
padding-top: 0.75em;
|
|
187
|
-
text-align: left;
|
|
188
|
-
}
|
|
189
|
-
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
|
|
190
|
-
div.verseblock + div.attribution {
|
|
191
|
-
text-align: left;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
div.admonitionblock .icon {
|
|
195
|
-
vertical-align: top;
|
|
196
|
-
font-size: 1.1em;
|
|
197
|
-
font-weight: bold;
|
|
198
|
-
text-decoration: underline;
|
|
199
|
-
color: #444466;
|
|
200
|
-
padding-right: 0.5em;
|
|
201
|
-
}
|
|
202
|
-
div.admonitionblock td.content {
|
|
203
|
-
padding-left: 0.5em;
|
|
204
|
-
border-left: 2px solid silver;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
div.exampleblock > div.content {
|
|
208
|
-
border-left: 2px solid silver;
|
|
209
|
-
padding: 0.5em;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
div.imageblock div.content { padding-left: 0; }
|
|
213
|
-
span.image img { border-style: none; }
|
|
214
|
-
a.image:visited { color: white; }
|
|
215
|
-
|
|
216
|
-
dl {
|
|
217
|
-
margin-top: 0.8em;
|
|
218
|
-
margin-bottom: 0.8em;
|
|
219
|
-
}
|
|
220
|
-
dt {
|
|
221
|
-
margin-top: 0.5em;
|
|
222
|
-
margin-bottom: 0;
|
|
223
|
-
font-style: normal;
|
|
224
|
-
color: #444466;
|
|
225
|
-
}
|
|
226
|
-
dd > *:first-child {
|
|
227
|
-
margin-top: 0.1em;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
ul, ol {
|
|
231
|
-
list-style-position: outside;
|
|
232
|
-
}
|
|
233
|
-
ol.arabic {
|
|
234
|
-
list-style-type: decimal;
|
|
235
|
-
}
|
|
236
|
-
ol.loweralpha {
|
|
237
|
-
list-style-type: lower-alpha;
|
|
238
|
-
}
|
|
239
|
-
ol.upperalpha {
|
|
240
|
-
list-style-type: upper-alpha;
|
|
241
|
-
}
|
|
242
|
-
ol.lowerroman {
|
|
243
|
-
list-style-type: lower-roman;
|
|
244
|
-
}
|
|
245
|
-
ol.upperroman {
|
|
246
|
-
list-style-type: upper-roman;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
div.compact ul, div.compact ol,
|
|
250
|
-
div.compact p, div.compact p,
|
|
251
|
-
div.compact div, div.compact div {
|
|
252
|
-
margin-top: 0.1em;
|
|
253
|
-
margin-bottom: 0.1em;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
div.tableblock > table {
|
|
257
|
-
border: 3px solid #444466;
|
|
258
|
-
}
|
|
259
|
-
thead {
|
|
260
|
-
font-weight: bold;
|
|
261
|
-
color: #444466;
|
|
262
|
-
}
|
|
263
|
-
tfoot {
|
|
264
|
-
font-weight: bold;
|
|
265
|
-
}
|
|
266
|
-
td > div.verse {
|
|
267
|
-
white-space: pre;
|
|
268
|
-
}
|
|
269
|
-
p.table {
|
|
270
|
-
margin-top: 0;
|
|
271
|
-
}
|
|
272
|
-
/* Because the table frame attribute is overriden by CSS in most browsers. */
|
|
273
|
-
div.tableblock > table[frame="void"] {
|
|
274
|
-
border-style: none;
|
|
275
|
-
}
|
|
276
|
-
div.tableblock > table[frame="hsides"] {
|
|
277
|
-
border-left-style: none;
|
|
278
|
-
border-right-style: none;
|
|
279
|
-
}
|
|
280
|
-
div.tableblock > table[frame="vsides"] {
|
|
281
|
-
border-top-style: none;
|
|
282
|
-
border-bottom-style: none;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
div.hdlist {
|
|
287
|
-
margin-top: 0.8em;
|
|
288
|
-
margin-bottom: 0.8em;
|
|
289
|
-
}
|
|
290
|
-
div.hdlist tr {
|
|
291
|
-
padding-bottom: 15px;
|
|
292
|
-
}
|
|
293
|
-
dt.hdlist1.strong, td.hdlist1.strong {
|
|
294
|
-
font-weight: bold;
|
|
295
|
-
}
|
|
296
|
-
td.hdlist1 {
|
|
297
|
-
vertical-align: top;
|
|
298
|
-
font-style: normal;
|
|
299
|
-
padding-right: 0.8em;
|
|
300
|
-
color: #444466;
|
|
301
|
-
}
|
|
302
|
-
td.hdlist2 {
|
|
303
|
-
vertical-align: top;
|
|
304
|
-
}
|
|
305
|
-
div.hdlist.compact tr {
|
|
306
|
-
margin: 0;
|
|
307
|
-
padding-bottom: 0;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.comment {
|
|
311
|
-
background: yellow;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
@media print {
|
|
315
|
-
#footer-badges { display: none; }
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
#toctitle {
|
|
319
|
-
color: #666688;
|
|
320
|
-
font-size: 1.2em;
|
|
321
|
-
font-weight: bold;
|
|
322
|
-
margin-top: 1.0em;
|
|
323
|
-
margin-bottom: 0.1em;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { margin-top: 0; margin-bottom: 0; }
|
|
327
|
-
div.toclevel1 { margin-top: 0.3em; margin-left: 0; font-size: 1.0em; }
|
|
328
|
-
div.toclevel2 { margin-top: 0.25em; margin-left: 2em; font-size: 0.9em; }
|
|
329
|
-
div.toclevel3 { margin-left: 4em; font-size: 0.8em; }
|
|
330
|
-
div.toclevel4 { margin-left: 6em; font-size: 0.8em; }
|
|
331
|
-
|
|
332
|
-
body {
|
|
333
|
-
margin: 1em 5%;
|
|
334
|
-
max-width: 55em;
|
|
335
|
-
padding-left: 0;
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.monospaced, tt, div.listingblock > div.content {
|
|
340
|
-
font-family: Consolas, "Andale Mono", "Courier New", monospace;
|
|
341
|
-
color: #004400;
|
|
342
|
-
background: #f4f4f4;
|
|
343
|
-
max-width: 80em;
|
|
344
|
-
line-height: 1.2em;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.paragraph p {
|
|
348
|
-
line-height: 1.5em;
|
|
349
|
-
margin-top: 1em;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.paragraph p, li, dd, .content { max-width: 45em; }
|
|
353
|
-
.admonitionblock { max-width: 35em; }
|
|
354
|
-
|
|
355
|
-
div.sectionbody div.ulist > ul > li {
|
|
356
|
-
list-style-type: square;
|
|
357
|
-
color: #aaa;
|
|
358
|
-
}
|
|
359
|
-
div.sectionbody div.ulist > ul > li > * {
|
|
360
|
-
color: black;
|
|
361
|
-
/*font-size: 50%;*/
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
div.sectionbody div.ulist > ul > li div.ulist > ul > li {
|
|
366
|
-
color: #ccd ;
|
|
367
|
-
}
|
|
368
|
-
div.sectionbody div.ulist > ul > li div.ulist > ul > li > * {
|
|
369
|
-
color: black ;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
em {
|
|
373
|
-
font-style: normal ! important;
|
|
374
|
-
font-weight: bold ! important;
|
|
375
|
-
color: #662222 ! important;
|
|
376
|
-
letter-spacing:+0.08em ! important;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
/*
|
|
381
|
-
* html5 specific
|
|
382
|
-
*
|
|
383
|
-
* */
|
|
384
|
-
|
|
385
|
-
table.tableblock {
|
|
386
|
-
margin-top: 1.0em;
|
|
387
|
-
margin-bottom: 1.5em;
|
|
388
|
-
}
|
|
389
|
-
thead, p.tableblock.header {
|
|
390
|
-
font-weight: bold;
|
|
391
|
-
color: #666688;
|
|
392
|
-
}
|
|
393
|
-
p.tableblock {
|
|
394
|
-
margin-top: 0;
|
|
395
|
-
}
|
|
396
|
-
table.tableblock {
|
|
397
|
-
border-width: 3px;
|
|
398
|
-
border-spacing: 0px;
|
|
399
|
-
border-style: solid;
|
|
400
|
-
border-color: #444466;
|
|
401
|
-
border-collapse: collapse;
|
|
402
|
-
}
|
|
403
|
-
th.tableblock, td.tableblock {
|
|
404
|
-
border-width: 1px;
|
|
405
|
-
padding: 4px;
|
|
406
|
-
border-style: solid;
|
|
407
|
-
border-color: #444466;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
table.tableblock.frame-topbot {
|
|
411
|
-
border-left-style: hidden;
|
|
412
|
-
border-right-style: hidden;
|
|
413
|
-
}
|
|
414
|
-
table.tableblock.frame-sides {
|
|
415
|
-
border-top-style: hidden;
|
|
416
|
-
border-bottom-style: hidden;
|
|
417
|
-
}
|
|
418
|
-
table.tableblock.frame-none {
|
|
419
|
-
border-style: hidden;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
th.tableblock.halign-left, td.tableblock.halign-left {
|
|
423
|
-
text-align: left;
|
|
424
|
-
}
|
|
425
|
-
th.tableblock.halign-center, td.tableblock.halign-center {
|
|
426
|
-
text-align: center;
|
|
427
|
-
}
|
|
428
|
-
th.tableblock.halign-right, td.tableblock.halign-right {
|
|
429
|
-
text-align: right;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
th.tableblock.valign-top, td.tableblock.valign-top {
|
|
433
|
-
vertical-align: top;
|
|
434
|
-
}
|
|
435
|
-
th.tableblock.valign-middle, td.tableblock.valign-middle {
|
|
436
|
-
vertical-align: middle;
|
|
437
|
-
}
|
|
438
|
-
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
|
|
439
|
-
vertical-align: bottom;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
/*
|
|
445
|
-
pygmentize filter
|
|
446
|
-
*/
|
|
447
|
-
.highlight .hll { background-color: #ffffcc }
|
|
448
|
-
.highlight { background: #f4f4f4; }
|
|
449
|
-
.highlight .c { color: #008800; font-style: italic } /* Comment */
|
|
450
|
-
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
|
451
|
-
.highlight .k { color: #AA22FF; font-weight: bold } /* Keyword */
|
|
452
|
-
.highlight .o { color: #666666 } /* Operator */
|
|
453
|
-
.highlight .cm { color: #008800; font-style: italic } /* Comment.Multiline */
|
|
454
|
-
.highlight .cp { color: #008800 } /* Comment.Preproc */
|
|
455
|
-
.highlight .c1 { color: #008800; font-style: italic } /* Comment.Single */
|
|
456
|
-
.highlight .cs { color: #008800; font-weight: bold } /* Comment.Special */
|
|
457
|
-
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
|
458
|
-
.highlight .ge { font-style: italic } /* Generic.Emph */
|
|
459
|
-
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
|
460
|
-
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
|
461
|
-
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
|
462
|
-
.highlight .go { color: #808080 } /* Generic.Output */
|
|
463
|
-
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
|
|
464
|
-
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
|
465
|
-
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
|
466
|
-
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
|
|
467
|
-
.highlight .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */
|
|
468
|
-
.highlight .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */
|
|
469
|
-
.highlight .kn { color: #AA22FF; font-weight: bold } /* Keyword.Namespace */
|
|
470
|
-
.highlight .kp { color: #AA22FF } /* Keyword.Pseudo */
|
|
471
|
-
.highlight .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */
|
|
472
|
-
.highlight .kt { color: #00BB00; font-weight: bold } /* Keyword.Type */
|
|
473
|
-
.highlight .m { color: #666666 } /* Literal.Number */
|
|
474
|
-
.highlight .s { color: #BB4444 } /* Literal.String */
|
|
475
|
-
.highlight .na { color: #BB4444 } /* Name.Attribute */
|
|
476
|
-
.highlight .nb { color: #AA22FF } /* Name.Builtin */
|
|
477
|
-
.highlight .nc { color: #0000FF } /* Name.Class */
|
|
478
|
-
.highlight .no { color: #880000 } /* Name.Constant */
|
|
479
|
-
.highlight .nd { color: #AA22FF } /* Name.Decorator */
|
|
480
|
-
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
|
|
481
|
-
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
|
|
482
|
-
.highlight .nf { color: #00A000 } /* Name.Function */
|
|
483
|
-
.highlight .nl { color: #A0A000 } /* Name.Label */
|
|
484
|
-
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
|
|
485
|
-
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
|
|
486
|
-
.highlight .nv { color: #B8860B } /* Name.Variable */
|
|
487
|
-
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
|
|
488
|
-
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
|
489
|
-
.highlight .mf { color: #666666 } /* Literal.Number.Float */
|
|
490
|
-
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
|
|
491
|
-
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
|
|
492
|
-
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
|
|
493
|
-
.highlight .sb { color: #BB4444 } /* Literal.String.Backtick */
|
|
494
|
-
.highlight .sc { color: #BB4444 } /* Literal.String.Char */
|
|
495
|
-
.highlight .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */
|
|
496
|
-
.highlight .s2 { color: #BB4444 } /* Literal.String.Double */
|
|
497
|
-
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
|
|
498
|
-
.highlight .sh { color: #BB4444 } /* Literal.String.Heredoc */
|
|
499
|
-
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
|
|
500
|
-
.highlight .sx { color: #008000 } /* Literal.String.Other */
|
|
501
|
-
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
|
|
502
|
-
.highlight .s1 { color: #BB4444 } /* Literal.String.Single */
|
|
503
|
-
.highlight .ss { color: #B8860B } /* Literal.String.Symbol */
|
|
504
|
-
.highlight .bp { color: #AA22FF } /* Name.Builtin.Pseudo */
|
|
505
|
-
.highlight .vc { color: #B8860B } /* Name.Variable.Class */
|
|
506
|
-
.highlight .vg { color: #B8860B } /* Name.Variable.Global */
|
|
507
|
-
.highlight .vi { color: #B8860B } /* Name.Variable.Instance */
|
|
508
|
-
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
@media screen {
|
|
512
|
-
body {
|
|
513
|
-
max-width: 50em; /* approximately 80 characters wide */
|
|
514
|
-
margin-left: 16em;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
#toc {
|
|
518
|
-
position: fixed;
|
|
519
|
-
top: 0;
|
|
520
|
-
left: 0;
|
|
521
|
-
bottom: 0;
|
|
522
|
-
width: 13em;
|
|
523
|
-
padding: 0.5em;
|
|
524
|
-
padding-bottom: 1.5em;
|
|
525
|
-
margin: 0;
|
|
526
|
-
overflow: auto;
|
|
527
|
-
border-right: 3px solid #f8f8f8;
|
|
528
|
-
background-color: white;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
#toc .toclevel1 {
|
|
532
|
-
margin-top: 0.5em;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
#toc .toclevel2 {
|
|
536
|
-
margin-top: 0.25em;
|
|
537
|
-
display: list-item;
|
|
538
|
-
color: #aaaaaa;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
#toctitle {
|
|
542
|
-
margin-top: 0.5em;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
</style>
|
|
546
|
-
<script type="text/javascript">
|
|
547
|
-
/*<+'])');
|
|
590
|
-
// Function that scans the DOM tree for header elements (the DOM2
|
|
591
|
-
// nodeIterator API would be a better technique but not supported by all
|
|
592
|
-
// browsers).
|
|
593
|
-
var iterate = function (el) {
|
|
594
|
-
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
|
595
|
-
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
|
596
|
-
var mo = re.exec(i.tagName);
|
|
597
|
-
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
|
|
598
|
-
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
|
599
|
-
}
|
|
600
|
-
iterate(i);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
iterate(el);
|
|
605
|
-
return result;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
var toc = document.getElementById("toc");
|
|
609
|
-
if (!toc) {
|
|
610
|
-
return;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
// Delete existing TOC entries in case we're reloading the TOC.
|
|
614
|
-
var tocEntriesToRemove = [];
|
|
615
|
-
var i;
|
|
616
|
-
for (i = 0; i < toc.childNodes.length; i++) {
|
|
617
|
-
var entry = toc.childNodes[i];
|
|
618
|
-
if (entry.nodeName.toLowerCase() == 'div'
|
|
619
|
-
&& entry.getAttribute("class")
|
|
620
|
-
&& entry.getAttribute("class").match(/^toclevel/))
|
|
621
|
-
tocEntriesToRemove.push(entry);
|
|
622
|
-
}
|
|
623
|
-
for (i = 0; i < tocEntriesToRemove.length; i++) {
|
|
624
|
-
toc.removeChild(tocEntriesToRemove[i]);
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// Rebuild TOC entries.
|
|
628
|
-
var entries = tocEntries(document.getElementById("content"), toclevels);
|
|
629
|
-
for (var i = 0; i < entries.length; ++i) {
|
|
630
|
-
var entry = entries[i];
|
|
631
|
-
if (entry.element.id == "")
|
|
632
|
-
entry.element.id = "_toc_" + i;
|
|
633
|
-
var a = document.createElement("a");
|
|
634
|
-
a.href = "#" + entry.element.id;
|
|
635
|
-
a.appendChild(document.createTextNode(entry.text));
|
|
636
|
-
var div = document.createElement("div");
|
|
637
|
-
div.appendChild(a);
|
|
638
|
-
div.className = "toclevel" + entry.toclevel;
|
|
639
|
-
toc.appendChild(div);
|
|
640
|
-
}
|
|
641
|
-
if (entries.length == 0)
|
|
642
|
-
toc.parentNode.removeChild(toc);
|
|
643
|
-
},
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
/////////////////////////////////////////////////////////////////////
|
|
647
|
-
// Footnotes generator
|
|
648
|
-
/////////////////////////////////////////////////////////////////////
|
|
649
|
-
|
|
650
|
-
/* Based on footnote generation code from:
|
|
651
|
-
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
|
652
|
-
*/
|
|
653
|
-
|
|
654
|
-
footnotes: function () {
|
|
655
|
-
// Delete existing footnote entries in case we're reloading the footnodes.
|
|
656
|
-
var i;
|
|
657
|
-
var noteholder = document.getElementById("footnotes");
|
|
658
|
-
if (!noteholder) {
|
|
659
|
-
return;
|
|
660
|
-
}
|
|
661
|
-
var entriesToRemove = [];
|
|
662
|
-
for (i = 0; i < noteholder.childNodes.length; i++) {
|
|
663
|
-
var entry = noteholder.childNodes[i];
|
|
664
|
-
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
|
|
665
|
-
entriesToRemove.push(entry);
|
|
666
|
-
}
|
|
667
|
-
for (i = 0; i < entriesToRemove.length; i++) {
|
|
668
|
-
noteholder.removeChild(entriesToRemove[i]);
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
// Rebuild footnote entries.
|
|
672
|
-
var cont = document.getElementById("content");
|
|
673
|
-
var spans = cont.getElementsByTagName("span");
|
|
674
|
-
var refs = {};
|
|
675
|
-
var n = 0;
|
|
676
|
-
for (i=0; i<spans.length; i++) {
|
|
677
|
-
if (spans[i].className == "footnote") {
|
|
678
|
-
n++;
|
|
679
|
-
var note = spans[i].getAttribute("data-note");
|
|
680
|
-
if (!note) {
|
|
681
|
-
// Use [\s\S] in place of . so multi-line matches work.
|
|
682
|
-
// Because JavaScript has no s (dotall) regex flag.
|
|
683
|
-
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
|
684
|
-
spans[i].innerHTML =
|
|
685
|
-
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
|
686
|
-
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
|
687
|
-
spans[i].setAttribute("data-note", note);
|
|
688
|
-
}
|
|
689
|
-
noteholder.innerHTML +=
|
|
690
|
-
"<div class='footnote' id='_footnote_" + n + "'>" +
|
|
691
|
-
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
|
692
|
-
n + "</a>. " + note + "</div>";
|
|
693
|
-
var id =spans[i].getAttribute("id");
|
|
694
|
-
if (id != null) refs["#"+id] = n;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
if (n == 0)
|
|
698
|
-
noteholder.parentNode.removeChild(noteholder);
|
|
699
|
-
else {
|
|
700
|
-
// Process footnoterefs.
|
|
701
|
-
for (i=0; i<spans.length; i++) {
|
|
702
|
-
if (spans[i].className == "footnoteref") {
|
|
703
|
-
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
|
704
|
-
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
|
705
|
-
n = refs[href];
|
|
706
|
-
spans[i].innerHTML =
|
|
707
|
-
"[<a href='#_footnote_" + n +
|
|
708
|
-
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
install: function(toclevels) {
|
|
715
|
-
var timerId;
|
|
716
|
-
|
|
717
|
-
function reinstall() {
|
|
718
|
-
asciidoc.footnotes();
|
|
719
|
-
if (toclevels) {
|
|
720
|
-
asciidoc.toc(toclevels);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
function reinstallAndRemoveTimer() {
|
|
725
|
-
clearInterval(timerId);
|
|
726
|
-
reinstall();
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
timerId = setInterval(reinstall, 500);
|
|
730
|
-
if (document.addEventListener)
|
|
731
|
-
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
|
|
732
|
-
else
|
|
733
|
-
window.onload = reinstallAndRemoveTimer;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
asciidoc.install(2);
|
|
738
|
-
/*]]>*/
|
|
739
|
-
</script>
|
|
740
|
-
</head>
|
|
741
|
-
<body class="article">
|
|
742
|
-
<div id="header">
|
|
743
|
-
<h1>FlukaIO: A library for particle exchange</h1>
|
|
744
|
-
<span id="author">David Siñuela Pastor</span><br>
|
|
745
|
-
<span id="email" class="monospaced"><<a href="mailto:david.sinuela.pastor@cern.ch">david.sinuela.pastor@cern.ch</a>></span><br>
|
|
746
|
-
<span id="revnumber">version 3.0RC2</span>
|
|
747
|
-
<div id="toc">
|
|
748
|
-
<div id="toctitle">Table of Contents</div>
|
|
749
|
-
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
|
|
750
|
-
</div>
|
|
751
|
-
</div>
|
|
752
|
-
<div id="content">
|
|
753
|
-
<div id="preamble">
|
|
754
|
-
<div class="sectionbody">
|
|
755
|
-
<div class="quoteblock">
|
|
756
|
-
<div class="title">Abstract</div>
|
|
757
|
-
<div class="content">
|
|
758
|
-
<div class="paragraph"><p>This document describes the FlukaIO protocol and discusses the implementation of
|
|
759
|
-
the FlukaIO library. FlukaIO is a message passing protocol on top of TCP/IP, it
|
|
760
|
-
was developed to enable the on-line communication of the Fluka Monte Carlo
|
|
761
|
-
particle tracker and single particle trackers as SixTrack or Icosim.</p></div>
|
|
762
|
-
</div>
|
|
763
|
-
<div class="attribution">
|
|
764
|
-
</div></div>
|
|
765
|
-
</div>
|
|
766
|
-
</div>
|
|
767
|
-
<div class="sect1">
|
|
768
|
-
<h2 id="_introduction">1. Introduction</h2>
|
|
769
|
-
<div class="sectionbody">
|
|
770
|
-
<div class="paragraph"><p>Two families of highly specialized simulators can be used to study the effects
|
|
771
|
-
of a beam in an accelerator. One family is used to study the effects of the
|
|
772
|
-
interaction of the beam with static matter, simulating individual particles and
|
|
773
|
-
their interactions as they go though the matter. This kind of simulations are
|
|
774
|
-
based on the Monte Carlo technique, after thousands of particles simulated the
|
|
775
|
-
averaged results are very similar to those observed in reality. The second
|
|
776
|
-
family, the single particle trackers, simulate the particles as they orbit
|
|
777
|
-
throughout the accelerator ring. These kind of trackers simulate individual
|
|
778
|
-
particles flying in the ring by applying them the optical functions of the ring
|
|
779
|
-
elements.</p></div>
|
|
780
|
-
<div class="paragraph"><p>For certain studies it is interesting to evaluate the long-term effects of the
|
|
781
|
-
beam-matter interactions on the beam dynamics and vice versa. Therefore each
|
|
782
|
-
kind of simulator plays an important role in these studies.</p></div>
|
|
783
|
-
<div class="paragraph"><p>The current coupling infrastructure was designed to support a simulation where
|
|
784
|
-
the beam circulates along the beam during thousands of turns. The trackig of the
|
|
785
|
-
particles is performed by a single particle tracker as SixTrack or Icosim, and
|
|
786
|
-
the Monte Carlo tracker Fluka is used to simulate one or more areas of the ring
|
|
787
|
-
where the beam-matter interaction effects are important.</p></div>
|
|
788
|
-
<div class="paragraph"><p>The test case simulation comprised a section of the accelerator with a moving
|
|
789
|
-
scraper, a scraper is a piece of matter that moves into the beam pipe producing
|
|
790
|
-
a reduction of the beam halo. With the infrastructure here described we were
|
|
791
|
-
able to simulate the long term effects of the scraper on the beam stability. Two
|
|
792
|
-
kind of outputs were obtained by these simulations: the pattern of lost
|
|
793
|
-
particles along the ring and the energy deposition on the scraper geometry.</p></div>
|
|
794
|
-
<div class="paragraph"><p>FlukaIO is the protocol and the library that provides the API for managing the
|
|
795
|
-
communication between the trackers. The library implements a message passing
|
|
796
|
-
protocol on top of TCP/IP and can be easily linked to other codes.</p></div>
|
|
797
|
-
<div class="paragraph"><p>Both trackers must run at the same time and they will transport the particles in
|
|
798
|
-
the portion of the accelerator that they are in charge to simulate. One of the
|
|
799
|
-
two processes acts as the server and the other acts as the client. The
|
|
800
|
-
disctinction only means that one process starts listening on one network port
|
|
801
|
-
and the other starts the connection to that process. After the connection is
|
|
802
|
-
established there is no disctinction in the way the server or the client work.</p></div>
|
|
803
|
-
<div class="paragraph"><p>In the current implementation Fluka is set up to be the server and the single
|
|
804
|
-
particle tracker acts as the client. By doing so we can easily change the single
|
|
805
|
-
particle tracker keeping the server code (which is slightly more complicated)
|
|
806
|
-
intact.</p></div>
|
|
807
|
-
<div class="sect2">
|
|
808
|
-
<h3 id="_getting_the_library">1.1. Getting the library</h3>
|
|
809
|
-
<div class="paragraph"><p>The library is distributed via the main CERN’s subversion repository
|
|
810
|
-
<a href="#flukaiosvn">[flukaiosvn]</a> as a source code package that must be compiled by the user.
|
|
811
|
-
There exist several tags on the repository marking stable releases, please try
|
|
812
|
-
to always use one of these. Compatible versions (API and protocol) are kept
|
|
813
|
-
under the same major version number. That is, applications using release version
|
|
814
|
-
2.0 can safely migrate to 2.1 and are encouraged to do so.</p></div>
|
|
815
|
-
</div>
|
|
816
|
-
<div class="sect2">
|
|
817
|
-
<h3 id="_compiling_and_linking">1.2. Compiling and Linking</h3>
|
|
818
|
-
<div class="paragraph"><p>The detailed instructions on how to compile FlukaIO can be found in the README
|
|
819
|
-
file. The resulting library can be linked to a variety of languages, please
|
|
820
|
-
refer to the documentation of your language to learn how to interoperate with C
|
|
821
|
-
libraries. We have successfully linked the library to software written in
|
|
822
|
-
Fortran 77, Fortran 90, C, C++ and Matlab.</p></div>
|
|
823
|
-
<div class="paragraph"><p>For C/C++ code the header files <span class="monospaced">FlukaIO.h</span> and <span class="monospaced">FlukaIOServer.h</span> must be
|
|
824
|
-
included. In the case of Fortran the interface is defined in <span class="monospaced">FortranFlukaIO.h</span>
|
|
825
|
-
and <span class="monospaced">FortranFlukaIOServer.h</span>.</p></div>
|
|
826
|
-
<div class="paragraph"><p>Four sample programs are provided in the <span class="monospaced">samples</span> folder, one
|
|
827
|
-
<a href="../samples/ClientTest.c">client</a> and <a href="../samples/ServerTest.c">server</a> in
|
|
828
|
-
C and one <a href="../samples/fclient.f">client</a> and
|
|
829
|
-
<a href="../samples/fserver.f">server</a> in Fortran. These can be used as a starting
|
|
830
|
-
point for developing new servers or clients.</p></div>
|
|
831
|
-
</div>
|
|
832
|
-
</div>
|
|
833
|
-
</div>
|
|
834
|
-
<div class="sect1">
|
|
835
|
-
<h2 id="_user_guide">2. User Guide</h2>
|
|
836
|
-
<div class="sectionbody">
|
|
837
|
-
<div class="sect2">
|
|
838
|
-
<h3 id="_execution_flow">2.1. Execution flow</h3>
|
|
839
|
-
<div class="paragraph"><p>In our setup both processes start executing aproximately at the same time.
|
|
840
|
-
Fluka takes the role of the server and starts listening on a network port and
|
|
841
|
-
the single particle tracker connects to the Fluka server.</p></div>
|
|
842
|
-
<div class="paragraph"><p>A handshake takes place when the communication is started and both processes
|
|
843
|
-
tell the other the version of the protocol they implement. If the major version
|
|
844
|
-
of the protocol differs they end the connection and an error is reported.</p></div>
|
|
845
|
-
<div class="paragraph"><p>Once the two processes have succesfully established the connection the
|
|
846
|
-
simulation starts on the single particle tracker.</p></div>
|
|
847
|
-
<div class="paragraph"><p>The particles are inserted and tracked along the lattice. The simulation
|
|
848
|
-
continues as normal until it reaches an element in the lattice labelled as a
|
|
849
|
-
Fluka element. At this point the simulation has to continue in Fluka, therefore
|
|
850
|
-
all the particles have to be sent to the Fluka process.</p></div>
|
|
851
|
-
<div class="paragraph"><p>Before sending the particles the single particle tracker must tell Fluka where
|
|
852
|
-
in space and time the particles have to be inserted. For that purpose the SPT
|
|
853
|
-
sends an Insertion PoinT message (IPT) which the lattice element number and
|
|
854
|
-
current turn. There must be a convention for Fluka to know which element number
|
|
855
|
-
corresponds to which position in the Fluka space and the turn number can be used
|
|
856
|
-
to compute the time shift in cases where it is important for the simulation.</p></div>
|
|
857
|
-
<div class="paragraph"><p>The particles are then sent to the Fluka process in individual messages followed
|
|
858
|
-
an End Of Bunch message (EOB). The SPT then remains waiting for incoming network
|
|
859
|
-
messages. Fluka tracks the particles one by one and sends them back to the SPT
|
|
860
|
-
if they reach the exit region of the geometry. Once all the particles received
|
|
861
|
-
by Fluka are sent or lost Fluka sends the end of bunch message to the SPT. Once
|
|
862
|
-
the SPT receives the EOB message knows all the remaining particles have been
|
|
863
|
-
received. The simulation continues in the single particle tracker from the next
|
|
864
|
-
element.</p></div>
|
|
865
|
-
<div class="paragraph"><p>The simulation will finish when the number of turns requested is exhausted or
|
|
866
|
-
because all the particles were lost. The SPT will send an End of Communication
|
|
867
|
-
message (EOC) and Fluka will reply with and EOC message to notify that the
|
|
868
|
-
message was received and the process is going to finish.</p></div>
|
|
869
|
-
<div class="paragraph"><p>The following diagram shows the data flow between the two processes:</p></div>
|
|
870
|
-
<div class="imageblock aafigure">
|
|
871
|
-
<div class="content">
|
|
872
|
-
<img src="FlukaIO__1.png" alt="FlukaIO__1.png">
|
|
873
|
-
</div>
|
|
874
|
-
</div>
|
|
875
|
-
<div class="paragraph"><p>Notice that the number of particles is always variable, not only particles can
|
|
876
|
-
be lost in the accelerator tracker or in the Fluka section but also new
|
|
877
|
-
particles can be generated in Fluka. Moreover, this processes can alter the
|
|
878
|
-
order of the particles sent back to the original process.</p></div>
|
|
879
|
-
</div>
|
|
880
|
-
<div class="sect2">
|
|
881
|
-
<h3 id="_types_of_messages">2.2. Types of Messages</h3>
|
|
882
|
-
<div class="paragraph"><p><strong>Particle Message</strong></p></div>
|
|
883
|
-
<div class="paragraph"><p>A message containing the data of a particle:</p></div>
|
|
884
|
-
<div class="ulist"><ul>
|
|
885
|
-
<li>
|
|
886
|
-
<p>
|
|
887
|
-
id: particle id
|
|
888
|
-
</p>
|
|
889
|
-
</li>
|
|
890
|
-
<li>
|
|
891
|
-
<p>
|
|
892
|
-
gen: particle generation
|
|
893
|
-
</p>
|
|
894
|
-
</li>
|
|
895
|
-
<li>
|
|
896
|
-
<p>
|
|
897
|
-
weigth: statistical weigth
|
|
898
|
-
</p>
|
|
899
|
-
</li>
|
|
900
|
-
<li>
|
|
901
|
-
<p>
|
|
902
|
-
x: position in cm
|
|
903
|
-
</p>
|
|
904
|
-
</li>
|
|
905
|
-
<li>
|
|
906
|
-
<p>
|
|
907
|
-
y: position in cm
|
|
908
|
-
</p>
|
|
909
|
-
</li>
|
|
910
|
-
<li>
|
|
911
|
-
<p>
|
|
912
|
-
z: position in cm
|
|
913
|
-
</p>
|
|
914
|
-
</li>
|
|
915
|
-
<li>
|
|
916
|
-
<p>
|
|
917
|
-
tx: director cosine along the x axis
|
|
918
|
-
</p>
|
|
919
|
-
</li>
|
|
920
|
-
<li>
|
|
921
|
-
<p>
|
|
922
|
-
ty: director cosine along the y axis
|
|
923
|
-
</p>
|
|
924
|
-
</li>
|
|
925
|
-
<li>
|
|
926
|
-
<p>
|
|
927
|
-
tz: director cosine along the z axis
|
|
928
|
-
</p>
|
|
929
|
-
</li>
|
|
930
|
-
<li>
|
|
931
|
-
<p>
|
|
932
|
-
aa: mass number
|
|
933
|
-
</p>
|
|
934
|
-
</li>
|
|
935
|
-
<li>
|
|
936
|
-
<p>
|
|
937
|
-
zz: ion charge
|
|
938
|
-
</p>
|
|
939
|
-
</li>
|
|
940
|
-
<li>
|
|
941
|
-
<p>
|
|
942
|
-
m: rest mass in GeV/c^2
|
|
943
|
-
</p>
|
|
944
|
-
</li>
|
|
945
|
-
<li>
|
|
946
|
-
<p>
|
|
947
|
-
p: momentum in GeV/c
|
|
948
|
-
</p>
|
|
949
|
-
</li>
|
|
950
|
-
<li>
|
|
951
|
-
<p>
|
|
952
|
-
t: time shift with respect to reference particle
|
|
953
|
-
</p>
|
|
954
|
-
</li>
|
|
955
|
-
</ul></div>
|
|
956
|
-
<div class="paragraph"><p><strong>End of batch</strong></p></div>
|
|
957
|
-
<div class="paragraph"><p>A message specifying that all the particles of the current turn/batch have been
|
|
958
|
-
processed and sent.</p></div>
|
|
959
|
-
<div class="paragraph"><p><strong>End of computation</strong></p></div>
|
|
960
|
-
<div class="paragraph"><p>Tells the other side that is ready to finish the simulation, the other end
|
|
961
|
-
should then reply with an end of computation message and finish the process.</p></div>
|
|
962
|
-
<div class="paragraph"><p><strong>Insertion point</strong></p></div>
|
|
963
|
-
<div class="paragraph"><p>Usually sent from the tracker to the Fluka process, it contains the turn number
|
|
964
|
-
and the elemenet number, instructing Fluka where the upcoming batch of particles
|
|
965
|
-
has to be inserted.</p></div>
|
|
966
|
-
<div class="paragraph"><p>As explained before, certain convention must exist among Fluka and the SPT,
|
|
967
|
-
Fluka must be able to know which position in the space corresponds to each of
|
|
968
|
-
the element identifiers.</p></div>
|
|
969
|
-
</div>
|
|
970
|
-
<div class="sect2">
|
|
971
|
-
<h3 id="_api">2.3. API</h3>
|
|
972
|
-
<div class="paragraph"><p>The API is splitted in two major sections: the client API and the server API.
|
|
973
|
-
The client API is used by both the client and the server, while the server API
|
|
974
|
-
contains only those functions needed to start the server. Two equivalent APIs
|
|
975
|
-
are provided, one in C and the other in Fortran. Since Fluka is implemented in
|
|
976
|
-
Fortran the Fortran interface is needed to use FlukaIO.</p></div>
|
|
977
|
-
<div class="paragraph"><div class="title">Note</div><p>All the API functions return -1 in case of error, the return value of every call
|
|
978
|
-
should always be checked.</p></div>
|
|
979
|
-
<div class="sect3">
|
|
980
|
-
<h4 id="_client_api">2.3.1. Client API</h4>
|
|
981
|
-
<div class="sect4">
|
|
982
|
-
<h5 id="_create_the_connection_object">Create the connection object</h5>
|
|
983
|
-
<div class="listingblock">
|
|
984
|
-
<div class="title">C</div>
|
|
985
|
-
<div class="content"><div class="highlight"><pre><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">flukaio_connect</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">host</span><span class="p">,</span> <span class="kt">int</span> <span class="n">port</span><span class="p">);</span>
|
|
986
|
-
</pre></div></div></div>
|
|
987
|
-
<div class="listingblock">
|
|
988
|
-
<div class="title">Fortran</div>
|
|
989
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntconnect</span><span class="p">(</span><span class="nv">host</span><span class="p">,</span> <span class="nv">port</span><span class="p">)</span>
|
|
990
|
-
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">host</span>
|
|
991
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">port</span>
|
|
992
|
-
</pre></div></div></div>
|
|
993
|
-
</div>
|
|
994
|
-
<div class="sect4">
|
|
995
|
-
<h5 id="_connect_to_a_flukaio_server_through_host_and_port">Connect to a FlukaIO server through host and port</h5>
|
|
996
|
-
<div class="paragraph"><p>This call connects the current process to a FlukaIO server and returns the
|
|
997
|
-
connection information. The connection should be opened at the initialization
|
|
998
|
-
phase of the program and closed before finishing the process.</p></div>
|
|
999
|
-
<div class="listingblock">
|
|
1000
|
-
<div class="title">C</div>
|
|
1001
|
-
<div class="content"><div class="highlight"><pre><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">flukaio_connect</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">host</span><span class="p">,</span> <span class="kt">int</span> <span class="n">port</span><span class="p">);</span>
|
|
1002
|
-
</pre></div></div></div>
|
|
1003
|
-
<div class="paragraph"><p>It returns a pointer to a new flukaio_connection_t structure that must be passed
|
|
1004
|
-
to all subsequent calls to the functions of the API.</p></div>
|
|
1005
|
-
<div class="paragraph"><p>As it is usually the first call to flukaio in the client code it is recommended
|
|
1006
|
-
to use it like follows:</p></div>
|
|
1007
|
-
<div class="listingblock">
|
|
1008
|
-
<div class="title">C</div>
|
|
1009
|
-
<div class="content"><div class="highlight"><pre><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span> <span class="o">=</span> <span class="n">flukaio_connect</span><span class="p">(</span><span class="n">flukaio_conn</span><span class="p">(),</span> <span class="s">"host"</span><span class="p">,</span> <span class="mi">1234</span><span class="p">);</span>
|
|
1010
|
-
</pre></div></div></div>
|
|
1011
|
-
<div class="listingblock">
|
|
1012
|
-
<div class="title">Fortran</div>
|
|
1013
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntconnect</span><span class="p">(</span><span class="nv">host</span><span class="p">,</span> <span class="nv">port</span><span class="p">)</span>
|
|
1014
|
-
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">host</span>
|
|
1015
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">port</span>
|
|
1016
|
-
</pre></div></div></div>
|
|
1017
|
-
<div class="paragraph"><p>In the case of Fortran the function returns an integer with the connection
|
|
1018
|
-
identifier that should be passed to all the following calls to the API. If the
|
|
1019
|
-
identifier is smaller than 0 an error occurred.</p></div>
|
|
1020
|
-
</div>
|
|
1021
|
-
<div class="sect4">
|
|
1022
|
-
<h5 id="_disconnect">Disconnect</h5>
|
|
1023
|
-
<div class="paragraph"><p>Closes the connection to the server and releases its resources. The connection
|
|
1024
|
-
memory is freed inside the call.</p></div>
|
|
1025
|
-
<div class="listingblock">
|
|
1026
|
-
<div class="title">C</div>
|
|
1027
|
-
<div class="content"><div class="highlight"><pre><span class="kt">void</span> <span class="n">flukaio_disconnect</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">);</span>
|
|
1028
|
-
</pre></div></div></div>
|
|
1029
|
-
<div class="listingblock">
|
|
1030
|
-
<div class="title">Fortran</div>
|
|
1031
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntend</span><span class="p">(</span><span class="nv">cid</span><span class="p">)</span>
|
|
1032
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1033
|
-
</pre></div></div></div>
|
|
1034
|
-
</div>
|
|
1035
|
-
<div class="sect4">
|
|
1036
|
-
<h5 id="_configure_connection_read_timeout">Configure connection read timeout</h5>
|
|
1037
|
-
<div class="paragraph"><p>Two functions are provided to read incoming particles: read_message and
|
|
1038
|
-
wait_message, the latter blocks the process until a message is received or an
|
|
1039
|
-
error occurred. It can happen that the other end of the communication never
|
|
1040
|
-
sends any message and therefore the process would keep waiting forever. This
|
|
1041
|
-
timeout specifies the maximum amount of time a wait_message call should wait.</p></div>
|
|
1042
|
-
<div class="listingblock">
|
|
1043
|
-
<div class="title">C</div>
|
|
1044
|
-
<div class="content"><div class="highlight"><pre><span class="kt">int</span> <span class="n">connection_set_read_timeout</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="kt">long</span> <span class="n">timeout</span><span class="p">);</span>
|
|
1045
|
-
</pre></div></div></div>
|
|
1046
|
-
<div class="listingblock">
|
|
1047
|
-
<div class="title">Fortran</div>
|
|
1048
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntrtimeout</span><span class="p">(</span><span class="nv">cid</span><span class="p">,</span> <span class="nv">seconds</span><span class="p">)</span>
|
|
1049
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1050
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">seconds</span>
|
|
1051
|
-
</pre></div></div></div>
|
|
1052
|
-
</div>
|
|
1053
|
-
<div class="sect4">
|
|
1054
|
-
<h5 id="_configure_connection_write_timeout">Configure connection write timeout</h5>
|
|
1055
|
-
<div class="listingblock">
|
|
1056
|
-
<div class="title">C</div>
|
|
1057
|
-
<div class="content"><div class="highlight"><pre><span class="kt">int</span> <span class="n">connection_set_write_timeout</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="kt">long</span> <span class="n">timeout</span><span class="p">);</span>
|
|
1058
|
-
</pre></div></div></div>
|
|
1059
|
-
<div class="listingblock">
|
|
1060
|
-
<div class="title">Fortran</div>
|
|
1061
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntwtimeout</span><span class="p">(</span><span class="nv">cid</span><span class="p">,</span> <span class="nv">seconds</span><span class="p">)</span>
|
|
1062
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1063
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">seconds</span>
|
|
1064
|
-
</pre></div></div></div>
|
|
1065
|
-
</div>
|
|
1066
|
-
<div class="sect4">
|
|
1067
|
-
<h5 id="_send_a_particle">Send a particle</h5>
|
|
1068
|
-
<div class="paragraph"><p>This call creates a particle message with the particle information provided and
|
|
1069
|
-
saves it in the outgoing buffer. The particle information can be safely modified
|
|
1070
|
-
immediately after calling this function.</p></div>
|
|
1071
|
-
<div class="paragraph"><p>In the case of C a particle_info_t pointer with the particle data must be passed
|
|
1072
|
-
and in the case of Fortran all the particle properties must be passed as
|
|
1073
|
-
arguments.</p></div>
|
|
1074
|
-
<div class="listingblock">
|
|
1075
|
-
<div class="title">C</div>
|
|
1076
|
-
<div class="content"><div class="highlight"><pre><span class="kt">ssize_t</span>
|
|
1077
|
-
<span class="n">flukaio_send_particle</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="k">const</span> <span class="n">particle_info_t</span> <span class="o">*</span><span class="n">part</span><span class="p">);</span>
|
|
1078
|
-
</pre></div></div></div>
|
|
1079
|
-
<div class="listingblock">
|
|
1080
|
-
<div class="title">Fortran</div>
|
|
1081
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntsendp</span><span class="p">(</span><span class="nv">cid</span><span class="p">,</span> <span class="nv">id</span><span class="p">,</span> <span class="nv">gen</span><span class="p">,</span> <span class="nv">wgt</span><span class="p">,</span> <span class="nv">x</span><span class="p">,</span> <span class="nv">y</span><span class="p">,</span> <span class="nv">z</span><span class="p">,</span> <span class="nv">tx</span><span class="p">,</span> <span class="nv">ty</span><span class="p">,</span> <span class="nv">tz</span><span class="p">,</span> <span class="nv">aa</span><span class="p">,</span> <span class="nv">zz</span><span class="p">,</span> <span class="nv">m</span><span class="p">,</span> <span class="nv">p</span><span class="p">,</span> <span class="nv">t</span><span class="p">)</span>
|
|
1082
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1083
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">id</span>
|
|
1084
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">gen</span>
|
|
1085
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">wgt</span>
|
|
1086
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">x</span>
|
|
1087
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">y</span>
|
|
1088
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">z</span>
|
|
1089
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">tx</span>
|
|
1090
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">ty</span>
|
|
1091
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">tz</span>
|
|
1092
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">aa</span>
|
|
1093
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">zz</span>
|
|
1094
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">m</span>
|
|
1095
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">p</span>
|
|
1096
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">t</span>
|
|
1097
|
-
</pre></div></div></div>
|
|
1098
|
-
</div>
|
|
1099
|
-
<div class="sect4">
|
|
1100
|
-
<h5 id="_send_end_of_batch_message">Send End Of Batch message</h5>
|
|
1101
|
-
<div class="paragraph"><p>End of turn message tells the other end that all the particles in the current
|
|
1102
|
-
batch were sent.</p></div>
|
|
1103
|
-
<div class="listingblock">
|
|
1104
|
-
<div class="title">C</div>
|
|
1105
|
-
<div class="content"><div class="highlight"><pre><span class="kt">ssize_t</span> <span class="n">flukaio_send_eob</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">);</span>
|
|
1106
|
-
</pre></div></div></div>
|
|
1107
|
-
<div class="listingblock">
|
|
1108
|
-
<div class="title">Fortran</div>
|
|
1109
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntsendeob</span><span class="p">(</span><span class="nv">cid</span><span class="p">)</span>
|
|
1110
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1111
|
-
</pre></div></div></div>
|
|
1112
|
-
</div>
|
|
1113
|
-
<div class="sect4">
|
|
1114
|
-
<h5 id="_send_insertion_point">Send Insertion Point</h5>
|
|
1115
|
-
<div class="paragraph"><p>Tells the other end where the following particles should be inserted. It sends
|
|
1116
|
-
an integer with the insertion point identifier and an integer with the turn
|
|
1117
|
-
number.</p></div>
|
|
1118
|
-
<div class="listingblock">
|
|
1119
|
-
<div class="title">C</div>
|
|
1120
|
-
<div class="content"><div class="highlight"><pre><span class="kt">ssize_t</span> <span class="n">flukaio_send_ipt</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">turn</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">ipt</span><span class="p">);</span>
|
|
1121
|
-
</pre></div></div></div>
|
|
1122
|
-
<div class="listingblock">
|
|
1123
|
-
<div class="title">Fortran</div>
|
|
1124
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntsendipt</span><span class="p">(</span><span class="nv">cid</span><span class="p">,</span> <span class="nv">ipt</span><span class="p">,</span> <span class="nv">turn</span><span class="p">)</span>
|
|
1125
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1126
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">ipt</span>
|
|
1127
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">turn</span>
|
|
1128
|
-
</pre></div></div></div>
|
|
1129
|
-
</div>
|
|
1130
|
-
<div class="sect4">
|
|
1131
|
-
<h5 id="_send_end_of_computation_message">Send End Of Computation message</h5>
|
|
1132
|
-
<div class="paragraph"><p>Informs the other end that the simulation has finished.</p></div>
|
|
1133
|
-
<div class="listingblock">
|
|
1134
|
-
<div class="title">C</div>
|
|
1135
|
-
<div class="content"><div class="highlight"><pre><span class="kt">ssize_t</span> <span class="n">flukaio_send_eoc</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">);</span>
|
|
1136
|
-
</pre></div></div></div>
|
|
1137
|
-
<div class="listingblock">
|
|
1138
|
-
<div class="title">Fortran</div>
|
|
1139
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntsendeoc</span><span class="p">(</span><span class="nv">cid</span><span class="p">)</span>
|
|
1140
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1141
|
-
</pre></div></div></div>
|
|
1142
|
-
</div>
|
|
1143
|
-
<div class="sect4">
|
|
1144
|
-
<h5 id="_read_a_message_non_blocking">Read a message (non-blocking)</h5>
|
|
1145
|
-
<div class="paragraph"><p>Reads messages from the incoming buffer, if nothing was read from the network
|
|
1146
|
-
returns -1, otherwise it returns the size of the read message.</p></div>
|
|
1147
|
-
<div class="listingblock">
|
|
1148
|
-
<div class="title">C</div>
|
|
1149
|
-
<div class="content"><div class="highlight"><pre><span class="kt">ssize_t</span>
|
|
1150
|
-
<span class="n">flukaio_receive_message</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="n">flukaio_message_t</span> <span class="o">*</span><span class="n">msg</span><span class="p">);</span>
|
|
1151
|
-
</pre></div></div></div>
|
|
1152
|
-
<div class="paragraph"><p>Stores the incoming message in msg. The type of the message can be inspected by
|
|
1153
|
-
looking at the msg.type field.</p></div>
|
|
1154
|
-
<div class="listingblock">
|
|
1155
|
-
<div class="title">Fortran</div>
|
|
1156
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntrecv</span><span class="p">(</span><span class="nv">cid</span><span class="p">,</span> <span class="nv">mtype</span><span class="p">,</span> <span class="nv">id</span><span class="p">,</span> <span class="nv">gen</span><span class="p">,</span> <span class="nv">wgt</span><span class="p">,</span> <span class="nv">x</span><span class="p">,</span> <span class="nv">y</span><span class="p">,</span> <span class="nv">z</span><span class="p">,</span> <span class="nv">tx</span><span class="p">,</span> <span class="nv">ty</span><span class="p">,</span> <span class="nv">tz</span><span class="p">,</span> <span class="nv">aa</span><span class="p">,</span> <span class="nv">zz</span><span class="p">,</span> <span class="nv">m</span><span class="p">,</span> <span class="nv">p</span><span class="p">,</span> <span class="nv">t</span><span class="p">)</span>
|
|
1157
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1158
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">mtype</span>
|
|
1159
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">id</span>
|
|
1160
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">gen</span>
|
|
1161
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">wgt</span>
|
|
1162
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">x</span>
|
|
1163
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">y</span>
|
|
1164
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">z</span>
|
|
1165
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">tx</span>
|
|
1166
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">ty</span>
|
|
1167
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">tz</span>
|
|
1168
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">aa</span>
|
|
1169
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">zz</span>
|
|
1170
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">m</span>
|
|
1171
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">p</span>
|
|
1172
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">t</span>
|
|
1173
|
-
</pre></div></div></div>
|
|
1174
|
-
<div class="paragraph"><p>Stores the incoming message in the arguments, the type of the message is stored
|
|
1175
|
-
in mtype.</p></div>
|
|
1176
|
-
</div>
|
|
1177
|
-
<div class="sect4">
|
|
1178
|
-
<h5 id="_read_a_message_blocking">Read a message (blocking)</h5>
|
|
1179
|
-
<div class="paragraph"><p>If no message was received it blocks the application until a message arrives.
|
|
1180
|
-
Returns -1 if an error occurred (the other end disconnected or the read
|
|
1181
|
-
operation timed out).</p></div>
|
|
1182
|
-
<div class="listingblock">
|
|
1183
|
-
<div class="title">C</div>
|
|
1184
|
-
<div class="content"><div class="highlight"><pre><span class="kt">ssize_t</span>
|
|
1185
|
-
<span class="n">flukaio_wait_message</span><span class="p">(</span><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">conn</span><span class="p">,</span> <span class="n">flukaio_message_t</span> <span class="o">*</span><span class="n">msg</span><span class="p">);</span>
|
|
1186
|
-
</pre></div></div></div>
|
|
1187
|
-
<div class="paragraph"><p>Stores the incoming message in msg. The type of the message can be inspected by
|
|
1188
|
-
looking at the msg.type field.</p></div>
|
|
1189
|
-
<div class="listingblock">
|
|
1190
|
-
<div class="title">Fortran</div>
|
|
1191
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntwait</span><span class="p">(</span><span class="nv">cid</span><span class="p">,</span> <span class="nv">mtype</span><span class="p">,</span> <span class="nv">id</span><span class="p">,</span> <span class="nv">gen</span><span class="p">,</span> <span class="nv">wgt</span><span class="p">,</span> <span class="nv">x</span><span class="p">,</span> <span class="nv">y</span><span class="p">,</span> <span class="nv">z</span><span class="p">,</span> <span class="nv">tx</span><span class="p">,</span> <span class="nv">ty</span><span class="p">,</span> <span class="nv">tz</span><span class="p">,</span> <span class="nv">aa</span><span class="p">,</span> <span class="nv">zz</span><span class="p">,</span> <span class="nv">m</span><span class="p">,</span> <span class="nv">p</span><span class="p">,</span> <span class="nv">t</span><span class="p">)</span>
|
|
1192
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">cid</span>
|
|
1193
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">mtype</span>
|
|
1194
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">id</span>
|
|
1195
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">gen</span>
|
|
1196
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">wgt</span>
|
|
1197
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">x</span>
|
|
1198
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">y</span>
|
|
1199
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">z</span>
|
|
1200
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">tx</span>
|
|
1201
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">ty</span>
|
|
1202
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">tz</span>
|
|
1203
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">aa</span>
|
|
1204
|
-
<span class="kt">integer</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">zz</span>
|
|
1205
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">m</span>
|
|
1206
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">p</span>
|
|
1207
|
-
<span class="kt">real</span><span class="p">(</span><span class="nb">kind</span><span class="o">=</span><span class="mi">8</span><span class="p">)</span> <span class="kd">::</span> <span class="nv">t</span>
|
|
1208
|
-
</pre></div></div></div>
|
|
1209
|
-
<div class="paragraph"><p>Stores the incoming message in the arguments, the type of the message is stored
|
|
1210
|
-
in mtype.</p></div>
|
|
1211
|
-
</div>
|
|
1212
|
-
</div>
|
|
1213
|
-
<div class="sect3">
|
|
1214
|
-
<h4 id="_server_api">2.3.2. Server API</h4>
|
|
1215
|
-
<div class="sect4">
|
|
1216
|
-
<h5 id="_create_server_object">Create server object.</h5>
|
|
1217
|
-
<div class="listingblock">
|
|
1218
|
-
<div class="title">C</div>
|
|
1219
|
-
<div class="content"><div class="highlight"><pre><span class="n">flukaio_server_t</span><span class="o">*</span> <span class="n">flukaio_server_create</span><span class="p">();</span>
|
|
1220
|
-
</pre></div></div></div>
|
|
1221
|
-
<div class="paragraph"><p>This creates a structure holding all server attributes. This structure has to be
|
|
1222
|
-
used to call all other server operations.</p></div>
|
|
1223
|
-
<div class="listingblock">
|
|
1224
|
-
<div class="title">Fortran</div>
|
|
1225
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntserver</span><span class="p">()</span>
|
|
1226
|
-
</pre></div></div></div>
|
|
1227
|
-
<div class="paragraph"><p>Returns the server identified to be used to all subsequetn calls.</p></div>
|
|
1228
|
-
</div>
|
|
1229
|
-
<div class="sect4">
|
|
1230
|
-
<h5 id="_setup_a_server_listening_on_port">Setup a server listening on port</h5>
|
|
1231
|
-
<div class="paragraph"><p>Returns the assigned port or -1 if error. The desired port can be specified in
|
|
1232
|
-
the port argument, if 0 is provided the port will be randomly assigned by the
|
|
1233
|
-
operating system.</p></div>
|
|
1234
|
-
<div class="listingblock">
|
|
1235
|
-
<div class="title">C</div>
|
|
1236
|
-
<div class="content"><div class="highlight"><pre><span class="kt">int</span> <span class="n">flukaio_server_start</span><span class="p">(</span><span class="n">flukaio_server_t</span><span class="o">*</span> <span class="n">server</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">port</span><span class="p">);</span>
|
|
1237
|
-
</pre></div></div></div>
|
|
1238
|
-
<div class="listingblock">
|
|
1239
|
-
<div class="title">Fortran</div>
|
|
1240
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntstart</span><span class="p">(</span><span class="nv">sid</span><span class="p">,</span> <span class="nv">port</span><span class="p">)</span>
|
|
1241
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">sid</span>
|
|
1242
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">port</span>
|
|
1243
|
-
</pre></div></div></div>
|
|
1244
|
-
<div class="paragraph"><p>The first variable is the serverid obtained with ntserver().</p></div>
|
|
1245
|
-
</div>
|
|
1246
|
-
<div class="sect4">
|
|
1247
|
-
<h5 id="_accept_connection">Accept connection</h5>
|
|
1248
|
-
<div class="paragraph"><p>Waits for a client connection and returns a structure with the connection
|
|
1249
|
-
information.</p></div>
|
|
1250
|
-
<div class="listingblock">
|
|
1251
|
-
<div class="title">C</div>
|
|
1252
|
-
<div class="content"><div class="highlight"><pre><span class="n">flukaio_connection_t</span> <span class="o">*</span><span class="n">flukaio_server_accept</span><span class="p">(</span><span class="n">flukaio_server_t</span><span class="o">*</span> <span class="n">server</span><span class="p">);</span>
|
|
1253
|
-
</pre></div></div></div>
|
|
1254
|
-
<div class="paragraph"><p>This returns the incoming connection object that can be used with the client
|
|
1255
|
-
API.</p></div>
|
|
1256
|
-
<div class="listingblock">
|
|
1257
|
-
<div class="title">Fortran</div>
|
|
1258
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntaccept</span><span class="p">(</span><span class="nv">sid</span><span class="p">)</span>
|
|
1259
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">sid</span>
|
|
1260
|
-
</pre></div></div></div>
|
|
1261
|
-
<div class="paragraph"><p>Returns a connection identifier if there was a connection, otherwise -1.</p></div>
|
|
1262
|
-
</div>
|
|
1263
|
-
<div class="sect4">
|
|
1264
|
-
<h5 id="_shutdown_server">Shutdown server</h5>
|
|
1265
|
-
<div class="paragraph"><p>Frees all server resources, stops listening for connections.</p></div>
|
|
1266
|
-
<div class="listingblock">
|
|
1267
|
-
<div class="title">C</div>
|
|
1268
|
-
<div class="content"><div class="highlight"><pre><span class="kt">int</span> <span class="n">flukaio_server_shutdown</span><span class="p">(</span><span class="n">flukaio_server_t</span><span class="o">*</span> <span class="n">server</span><span class="p">);</span>
|
|
1269
|
-
</pre></div></div></div>
|
|
1270
|
-
<div class="listingblock">
|
|
1271
|
-
<div class="title">Fortran</div>
|
|
1272
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntshwnd</span><span class="p">()</span>
|
|
1273
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">sid</span>
|
|
1274
|
-
</pre></div></div></div>
|
|
1275
|
-
</div>
|
|
1276
|
-
<div class="sect4">
|
|
1277
|
-
<h5 id="_get_server_port">Get server port</h5>
|
|
1278
|
-
<div class="paragraph"><p>Returns the port number on which the server is listening.</p></div>
|
|
1279
|
-
<div class="listingblock">
|
|
1280
|
-
<div class="title">C</div>
|
|
1281
|
-
<div class="content"><div class="highlight"><pre><span class="kt">int</span> <span class="n">flukaio_server_get_port</span><span class="p">(</span><span class="n">flukaio_server_t</span><span class="o">*</span> <span class="n">server</span><span class="p">);</span>
|
|
1282
|
-
</pre></div></div></div>
|
|
1283
|
-
<div class="listingblock">
|
|
1284
|
-
<div class="title">Fortran</div>
|
|
1285
|
-
<div class="content"><div class="highlight"><pre><span class="kt">integer </span><span class="k">function </span><span class="nv">ntgetport</span><span class="p">(</span><span class="nv">sid</span><span class="p">)</span>
|
|
1286
|
-
<span class="kt">integer</span> <span class="kd">::</span> <span class="nv">sid</span>
|
|
1287
|
-
</pre></div></div></div>
|
|
1288
|
-
</div>
|
|
1289
|
-
</div>
|
|
1290
|
-
</div>
|
|
1291
|
-
<div class="sect2">
|
|
1292
|
-
<h3 id="_troubleshooting">2.4. Troubleshooting</h3>
|
|
1293
|
-
<div class="paragraph"><p>The source code is distributed with a complete test suite under the folder
|
|
1294
|
-
“tests”. In order to run the tests the CppUTest [1] test harness must be
|
|
1295
|
-
correctly installed. If CppUTest is installed the test suite is executed and a
|
|
1296
|
-
report is generated each time the code is compiled using make.</p></div>
|
|
1297
|
-
<div class="paragraph"><p>If something is failing please run the test suite and check that everything is
|
|
1298
|
-
working as expected. If that is the case try to sniff the network connection
|
|
1299
|
-
with <span class="monospaced">tcpdump</span>.</p></div>
|
|
1300
|
-
</div>
|
|
1301
|
-
</div>
|
|
1302
|
-
</div>
|
|
1303
|
-
<div class="sect1">
|
|
1304
|
-
<h2 id="_technical_documentation">3. Technical documentation</h2>
|
|
1305
|
-
<div class="sectionbody">
|
|
1306
|
-
<div class="sect2">
|
|
1307
|
-
<h3 id="_main_flukaio_features">3.1. Main FlukaIO features</h3>
|
|
1308
|
-
<div class="paragraph"><p>Although FlukaIO is meant to link Fluka to single particle tracking codes it has
|
|
1309
|
-
been designed to be extensible, a small list of features follows:</p></div>
|
|
1310
|
-
<div class="ulist"><ul>
|
|
1311
|
-
<li>
|
|
1312
|
-
<p>
|
|
1313
|
-
Two equivalent APIs, the native C API and a compatibility layer for Fortran
|
|
1314
|
-
codes.
|
|
1315
|
-
</p>
|
|
1316
|
-
</li>
|
|
1317
|
-
<li>
|
|
1318
|
-
<p>
|
|
1319
|
-
TCP/IP communication: enabling client/server architectures
|
|
1320
|
-
</p>
|
|
1321
|
-
</li>
|
|
1322
|
-
<li>
|
|
1323
|
-
<p>
|
|
1324
|
-
Variable size messages to use minimum bandwidth
|
|
1325
|
-
</p>
|
|
1326
|
-
</li>
|
|
1327
|
-
<li>
|
|
1328
|
-
<p>
|
|
1329
|
-
Extensible list of message types, implemented now: particle, end of turn, end
|
|
1330
|
-
of computation and insertion point
|
|
1331
|
-
</p>
|
|
1332
|
-
</li>
|
|
1333
|
-
<li>
|
|
1334
|
-
<p>
|
|
1335
|
-
Buffered input and output to improve performance
|
|
1336
|
-
</p>
|
|
1337
|
-
</li>
|
|
1338
|
-
<li>
|
|
1339
|
-
<p>
|
|
1340
|
-
Modular Object-Oriented architecture
|
|
1341
|
-
</p>
|
|
1342
|
-
</li>
|
|
1343
|
-
<li>
|
|
1344
|
-
<p>
|
|
1345
|
-
Complete test-suite
|
|
1346
|
-
</p>
|
|
1347
|
-
</li>
|
|
1348
|
-
</ul></div>
|
|
1349
|
-
</div>
|
|
1350
|
-
<div class="sect2">
|
|
1351
|
-
<h3 id="_protocol_description">3.2. Protocol Description</h3>
|
|
1352
|
-
<div class="sect3">
|
|
1353
|
-
<h4 id="_message_format">3.2.1. Message format</h4>
|
|
1354
|
-
<div class="paragraph"><p>The messages have this common header format:</p></div>
|
|
1355
|
-
<div class="imageblock aafigure">
|
|
1356
|
-
<div class="content">
|
|
1357
|
-
<img src="FlukaIO__2.png" alt="FlukaIO__2.png">
|
|
1358
|
-
</div>
|
|
1359
|
-
</div>
|
|
1360
|
-
<div class="paragraph"><p>The header of the message contains the total size of the message in bytes
|
|
1361
|
-
(unsigned integer: 2 bytes) and the type of message (unsigned integer: 1 byte),
|
|
1362
|
-
3 bytes in total.</p></div>
|
|
1363
|
-
</div>
|
|
1364
|
-
<div class="sect3">
|
|
1365
|
-
<h4 id="_types_of_messages_2">3.2.2. Types of Messages</h4>
|
|
1366
|
-
<div class="paragraph"><p>The type field in a message can have one of these values:</p></div>
|
|
1367
|
-
<div class="ulist"><ul>
|
|
1368
|
-
<li>
|
|
1369
|
-
<p>
|
|
1370
|
-
<strong>0 = ERR</strong>: Error (used internally)
|
|
1371
|
-
</p>
|
|
1372
|
-
</li>
|
|
1373
|
-
<li>
|
|
1374
|
-
<p>
|
|
1375
|
-
<strong>1 = PART</strong>: A message containing a particle
|
|
1376
|
-
</p>
|
|
1377
|
-
</li>
|
|
1378
|
-
<li>
|
|
1379
|
-
<p>
|
|
1380
|
-
<strong>2 = TURN</strong>: End of turn message
|
|
1381
|
-
</p>
|
|
1382
|
-
</li>
|
|
1383
|
-
<li>
|
|
1384
|
-
<p>
|
|
1385
|
-
<strong>3 = END</strong>: End of computation
|
|
1386
|
-
</p>
|
|
1387
|
-
</li>
|
|
1388
|
-
<li>
|
|
1389
|
-
<p>
|
|
1390
|
-
<strong>4 = CONF</strong>: Configuration, reserved
|
|
1391
|
-
</p>
|
|
1392
|
-
</li>
|
|
1393
|
-
<li>
|
|
1394
|
-
<p>
|
|
1395
|
-
<strong>5 = IPT</strong>: Insertion point
|
|
1396
|
-
</p>
|
|
1397
|
-
</li>
|
|
1398
|
-
</ul></div>
|
|
1399
|
-
<div class="paragraph"><p>The message types and their meanings are not strictly defined, interpretation
|
|
1400
|
-
depends on the application. Following definitions are just a guideline.</p></div>
|
|
1401
|
-
<div class="sect4">
|
|
1402
|
-
<h5 id="_error_message">Error message</h5>
|
|
1403
|
-
<div class="paragraph"><p>When the reads a message of type ERR means that the incoming message was not
|
|
1404
|
-
recognised. It is used internally, but it is also the type of message that the
|
|
1405
|
-
functions read_message and wait_message return when there is an error (in
|
|
1406
|
-
addition to returning -1).</p></div>
|
|
1407
|
-
</div>
|
|
1408
|
-
<div class="sect4">
|
|
1409
|
-
<h5 id="_particle_message">Particle message</h5>
|
|
1410
|
-
<div class="paragraph"><p>Contains a particle in the data section, for more details read the header file
|
|
1411
|
-
<span class="monospaced">include/ParticleInfo.h</span>:</p></div>
|
|
1412
|
-
<div class="imageblock aafigure">
|
|
1413
|
-
<div class="content">
|
|
1414
|
-
<img src="FlukaIO__3.png" alt="FlukaIO__3.png">
|
|
1415
|
-
</div>
|
|
1416
|
-
</div>
|
|
1417
|
-
</div>
|
|
1418
|
-
<div class="sect4">
|
|
1419
|
-
<h5 id="_end_of_batch_message">End Of Batch message</h5>
|
|
1420
|
-
<div class="paragraph"><p>Empty message communicating that all the particles were sent.</p></div>
|
|
1421
|
-
</div>
|
|
1422
|
-
<div class="sect4">
|
|
1423
|
-
<h5 id="_end_of_computation_message">End Of Computation message</h5>
|
|
1424
|
-
<div class="paragraph"><p>Informs the other end that computation was finished and must disconnect. Doesn’t
|
|
1425
|
-
contain any data.</p></div>
|
|
1426
|
-
</div>
|
|
1427
|
-
<div class="sect4">
|
|
1428
|
-
<h5 id="_insertion_point">Insertion point</h5>
|
|
1429
|
-
<div class="paragraph"><p>Contains a 4 bytes unsigned integer with the insertion point number, and a 4
|
|
1430
|
-
bytes unsigned integer with the turn number.</p></div>
|
|
1431
|
-
<div class="imageblock aafigure">
|
|
1432
|
-
<div class="content">
|
|
1433
|
-
<img src="FlukaIO__4.png" alt="FlukaIO__4.png">
|
|
1434
|
-
</div>
|
|
1435
|
-
</div>
|
|
1436
|
-
</div>
|
|
1437
|
-
</div>
|
|
1438
|
-
</div>
|
|
1439
|
-
<div class="sect2">
|
|
1440
|
-
<h3 id="_logical_structure">3.3. Logical Structure</h3>
|
|
1441
|
-
<div class="imageblock aafigure">
|
|
1442
|
-
<div class="content">
|
|
1443
|
-
<img src="FlukaIO__5.png" alt="FlukaIO__5.png">
|
|
1444
|
-
</div>
|
|
1445
|
-
</div>
|
|
1446
|
-
<div class="paragraph"><p>The library offers two APIs: FlukaIO and FlukaIOServer, a client application
|
|
1447
|
-
would normally use only FlukaIO while a server application would use both.</p></div>
|
|
1448
|
-
<div class="paragraph"><p>When a connection is established the FlukaIO library returns a Connection object
|
|
1449
|
-
(or connection id in the Fortran interface) which holds all the data needed
|
|
1450
|
-
during a communication session.</p></div>
|
|
1451
|
-
<div class="paragraph"><p>All the incoming and outgoing messages are sent through a Connection object,
|
|
1452
|
-
which stores them in the appropriate buffer if needed. When enough data is
|
|
1453
|
-
stored in the output buffer or a flush operation is requested the connection
|
|
1454
|
-
object sends all the contents of the output buffer and erases them from memory.</p></div>
|
|
1455
|
-
<div class="paragraph"><p>All network operations are defined as function pointers in the Connection
|
|
1456
|
-
struct. This is used to replace all operating system calls during tests avoiding
|
|
1457
|
-
hitting the network and providing reliable and replicable test results.</p></div>
|
|
1458
|
-
</div>
|
|
1459
|
-
<div class="sect2">
|
|
1460
|
-
<h3 id="_data_flow_diagrams">3.4. Data flow diagrams</h3>
|
|
1461
|
-
<div class="paragraph"><p>In this section of the document an overview of the data flow is provided showing
|
|
1462
|
-
the collaboration between the different components of the library.</p></div>
|
|
1463
|
-
<div class="sect3">
|
|
1464
|
-
<h4 id="_starting_and_ending_communication">3.4.1. Starting and ending communication</h4>
|
|
1465
|
-
<div class="imageblock aafigure">
|
|
1466
|
-
<div class="content">
|
|
1467
|
-
<img src="FlukaIO__6.png" alt="FlukaIO__6.png">
|
|
1468
|
-
</div>
|
|
1469
|
-
</div>
|
|
1470
|
-
</div>
|
|
1471
|
-
<div class="sect3">
|
|
1472
|
-
<h4 id="_sending_messages">3.4.2. Sending messages</h4>
|
|
1473
|
-
<div class="imageblock aafigure">
|
|
1474
|
-
<div class="content">
|
|
1475
|
-
<img src="FlukaIO__7.png" alt="FlukaIO__7.png">
|
|
1476
|
-
</div>
|
|
1477
|
-
</div>
|
|
1478
|
-
<div class="paragraph"><p>End Of Computation messages are not shown in the diagram because they follow the
|
|
1479
|
-
same execution flow as the End Of Batch in the sense that they are synchronous
|
|
1480
|
-
as well.</p></div>
|
|
1481
|
-
</div>
|
|
1482
|
-
</div>
|
|
1483
|
-
<div class="sect2">
|
|
1484
|
-
<h3 id="_how_to">3.5. How to</h3>
|
|
1485
|
-
<div class="sect3">
|
|
1486
|
-
<h4 id="_add_new_fields_to_particles">3.5.1. Add new fields to particles</h4>
|
|
1487
|
-
<div class="paragraph"><p>If the partile structure is to be modified this approach is recommended:</p></div>
|
|
1488
|
-
<div class="olist arabic"><ol class="arabic">
|
|
1489
|
-
<li>
|
|
1490
|
-
<p>
|
|
1491
|
-
Add the field to particle_info_t (<span class="monospaced">include/ParticleInfo.h</span>)
|
|
1492
|
-
</p>
|
|
1493
|
-
</li>
|
|
1494
|
-
<li>
|
|
1495
|
-
<p>
|
|
1496
|
-
Update <span class="monospaced">PARTICLES_EQUAL</span> helpers in tests (<span class="monospaced">tests/FlukaIOTest.cpp</span> and
|
|
1497
|
-
<span class="monospaced">tests/FortranFlukaIO.cpp</span>)
|
|
1498
|
-
</p>
|
|
1499
|
-
</li>
|
|
1500
|
-
<li>
|
|
1501
|
-
<p>
|
|
1502
|
-
Run the tests and correct the code if they fail.
|
|
1503
|
-
</p>
|
|
1504
|
-
</li>
|
|
1505
|
-
</ol></div>
|
|
1506
|
-
<div class="paragraph"><p>The Fortran interface will need more work than the C interface because it
|
|
1507
|
-
exposes each individual field in the function signatures. Because of this the
|
|
1508
|
-
Fortran samples have to be updated to reflect the new interface. The C samples
|
|
1509
|
-
should still be working after the change.</p></div>
|
|
1510
|
-
</div>
|
|
1511
|
-
<div class="sect3">
|
|
1512
|
-
<h4 id="_add_new_message_types">3.5.2. Add new message types</h4>
|
|
1513
|
-
<div class="paragraph"><p>New message types can be introduced by adding the message id to the enum
|
|
1514
|
-
<span class="monospaced">message_type_t</span> found in <span class="monospaced">include/message.h</span> and modifying the FlukaIO logic.
|
|
1515
|
-
In case more variable size messages have to be implemented the data union field
|
|
1516
|
-
in flukaio_message_t structure can be modified to store the new data.</p></div>
|
|
1517
|
-
</div>
|
|
1518
|
-
</div>
|
|
1519
|
-
</div>
|
|
1520
|
-
</div>
|
|
1521
|
-
<div class="sect1">
|
|
1522
|
-
<h2 id="_credits">4. Credits</h2>
|
|
1523
|
-
<div class="sectionbody">
|
|
1524
|
-
<div class="ulist"><ul>
|
|
1525
|
-
<li>
|
|
1526
|
-
<p>
|
|
1527
|
-
David Siñuela Pastor <<a href="mailto:david.sinuela.pastor@cern.ch">david.sinuela.pastor@cern.ch</a>>
|
|
1528
|
-
</p>
|
|
1529
|
-
</li>
|
|
1530
|
-
<li>
|
|
1531
|
-
<p>
|
|
1532
|
-
Alessio Mereghetti <<a href="mailto:Alessio.Mereghetti@cern.ch">Alessio.Mereghetti@cern.ch</a>>
|
|
1533
|
-
</p>
|
|
1534
|
-
</li>
|
|
1535
|
-
<li>
|
|
1536
|
-
<p>
|
|
1537
|
-
Vasilis Vlachoudis <<a href="mailto:Vasilis.Vlachoudis@cern.ch">Vasilis.Vlachoudis@cern.ch</a>>
|
|
1538
|
-
</p>
|
|
1539
|
-
</li>
|
|
1540
|
-
<li>
|
|
1541
|
-
<p>
|
|
1542
|
-
Francesco Cerutti <<a href="mailto:Francesco.Cerutti@cern.ch">Francesco.Cerutti@cern.ch</a>>
|
|
1543
|
-
</p>
|
|
1544
|
-
</li>
|
|
1545
|
-
<li>
|
|
1546
|
-
<p>
|
|
1547
|
-
Joel Francois Clivaz <<a href="mailto:joel.francois.clivaz@cern.ch">joel.francois.clivaz@cern.ch</a>>
|
|
1548
|
-
</p>
|
|
1549
|
-
</li>
|
|
1550
|
-
</ul></div>
|
|
1551
|
-
</div>
|
|
1552
|
-
</div>
|
|
1553
|
-
<div class="sect1">
|
|
1554
|
-
<h2 id="_references">5. References</h2>
|
|
1555
|
-
<div class="sectionbody">
|
|
1556
|
-
<div class="ulist bibliography"><ul>
|
|
1557
|
-
<li>
|
|
1558
|
-
<p>
|
|
1559
|
-
<a id="flukaiosvn"></a>[flukaiosvn] . <em>FlukaIO subversion repository</em> .
|
|
1560
|
-
<a href="http://svnweb.cern.ch/world/wsvn/FlukaIO">http://svnweb.cern.ch/world/wsvn/FlukaIO</a>
|
|
1561
|
-
</p>
|
|
1562
|
-
</li>
|
|
1563
|
-
<li>
|
|
1564
|
-
<p>
|
|
1565
|
-
<a id="cpputest"></a>[cpputest] . <em>CppUTest</em>. <a href="http://sourceforge.net/projects/cpputest/">http://sourceforge.net/projects/cpputest/</a>
|
|
1566
|
-
</p>
|
|
1567
|
-
</li>
|
|
1568
|
-
<li>
|
|
1569
|
-
<p>
|
|
1570
|
-
<a id="flukadesc"></a>[flukadesc] . G. Battistoni, S. Muraro, P.R. Sala, F. Cerutti, A.
|
|
1571
|
-
Ferrari, S. Roesler, A. Fasso`, J. Ranft . <em>The FLUKA code: Description and
|
|
1572
|
-
benchmarking</em> . Proceedings of the Hadronic Shower Simulation Workshop 2006,
|
|
1573
|
-
Fermilab 6—8 September 2006, M. Albrow, R. Raja eds., AIP Conference Proceeding
|
|
1574
|
-
896, 31-49, (2007)
|
|
1575
|
-
</p>
|
|
1576
|
-
</li>
|
|
1577
|
-
<li>
|
|
1578
|
-
<p>
|
|
1579
|
-
<a id="flukacode"></a>[flukacode] . A. Fasso`, A. Ferrari, J. Ranft, and P.R. Sala . <em>FLUKA: a
|
|
1580
|
-
multi-particle transport code</em> . CERN-2005-10 (2005), INFN/TC_05/11, SLAC-R-773
|
|
1581
|
-
</p>
|
|
1582
|
-
</li>
|
|
1583
|
-
<li>
|
|
1584
|
-
<p>
|
|
1585
|
-
<a id="sixtrack"></a>[sixtrack] . F. Schmidt . <em>SixTrack, User’s Reference Manual</em> . CERN
|
|
1586
|
-
SL/94-56 (AP), 1994.
|
|
1587
|
-
</p>
|
|
1588
|
-
</li>
|
|
1589
|
-
<li>
|
|
1590
|
-
<p>
|
|
1591
|
-
<a id="icosim"></a>[icosim] . Holden, N . <em>Development of the ICOSIM Program and Application
|
|
1592
|
-
to Magnetised Collimators in the LHC</em> . CERN-AB-Note-2008-054, 2008
|
|
1593
|
-
</p>
|
|
1594
|
-
</li>
|
|
1595
|
-
</ul></div>
|
|
1596
|
-
</div>
|
|
1597
|
-
</div>
|
|
1598
|
-
</div>
|
|
1599
|
-
<div id="footnotes"><hr></div>
|
|
1600
|
-
<div id="footer">
|
|
1601
|
-
<div id="footer-text">
|
|
1602
|
-
Version 3.0RC2<br>
|
|
1603
|
-
Last updated 2012-10-05 15:47:42 CEST
|
|
1604
|
-
</div>
|
|
1605
|
-
</div>
|
|
1606
|
-
</body>
|
|
1607
|
-
</html>
|