forked from SmileiPIC/Smilei
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontribute.html
740 lines (689 loc) · 34.5 KB
/
contribute.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contribute — Smilei v4.1-163-g011c2ce8 documentation</title>
<link rel="stylesheet" href="_static/smilei_theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://www.gitcdn.xyz/repo/mathjax/MathJax/master/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="_static/smileiIcon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Publications" href="material.html" />
<link rel="prev" title="Post-process" href="post-processing.html" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
scale: 95,
availableFonts: ["TeX"]
}
});
</script>
</head><body>
<div id="smallScreenMenu" class="off">
<div class="toctree-smilei">
<ul>
<li class="outer">
<a href="licence.html">Licence</a>
</li>
<li class="outer">
<a href="synopsis.html">Synopsis</a>
</li>
<li class="outer">
<a href="highlights.html">Highlights</a>
</li>
<li class="outer">
<a href="releases.html">Releases</a>
</li>
</ul>
<hr />
<ul>
<li class="outer">
<a href="units.html">Units</a>
</li>
<li class="outer">
<a href="algorithms.html">PIC algorithms</a>
</li>
<li class="outer">
<a href="parallelization.html">Parallelization basics</a>
</li>
<li class="outer">
<a href="vectorization.html">Vectorization</a>
</li>
<li class="outer">
<a href="collisions.html">Binary collisions</a>
</li>
<li class="outer">
<a href="ionization.html">Ionization</a>
</li>
<li class="outer">
<a href="radiation_loss.html">Synchrotron-like radiation reaction</a>
</li>
<li class="outer">
<a href="multiphoton_Breit_Wheeler.html">Multiphoton Breit-Wheeler pair creation</a>
</li>
<li class="outer">
<a href="laser_envelope.html">Laser envelope model</a>
</li>
<li class="outer">
<a href="relativistic_fields_initialization.html">Field initialization for relativistic species</a>
</li>
</ul>
<hr />
<ul>
<li class="outer">
<a href="installation.html">Install</a>
</li>
<li class="outer">
<a href="namelist.html">Write a namelist</a>
</li>
<li class="outer">
<a href="run.html">Run</a>
</li>
<li class="outer">
<a href="post-processing.html">Post-process</a>
</li>
</ul>
<ul>
<li><a class="reference internal" href="#">Contribute</a><ul>
<li><a class="reference internal" href="#write-documentation">Write documentation</a></li>
<li><a class="reference internal" href="#validate-your-changes">Validate your changes</a></li>
</ul>
</li>
</ul>
<ul>
</ul>
<hr />
<ul>
<li class="outer">
<a href="material.html">Publications</a>
</li>
<li class="outer">
<a href="partners.html">Partners</a>
</li>
<li class="outer">
<a href="https://smileipic.github.io/tutorials">Smilei tutorials</a>
</li>
</ul>
</div>
</div>
<div id="hcontainer">
<div id="nav_positioner">
<div id="nav">
<div id="nav_button" onclick="toggleNav()">
Sections
</div>
<div id="nav_list" class="toctree-smilei">
<div id="nav_title"><a href="#">Contribute</a></div>
<ul>
<li><a class="reference internal" href="#">Contribute</a><ul>
<li><a class="reference internal" href="#write-documentation">Write documentation</a></li>
<li><a class="reference internal" href="#validate-your-changes">Validate your changes</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="headercolor">
</div>
<div class="hpositioner">
<div class="header">
<div class="logo">
<a href="index.html">
<img class="logo" src="_static/smileiLogo.svg" alt="Logo" />
</a>
</div>
<div class="menu" id="menu_Licence">
<div id="menuButton_Licence" class="menuButton"
onmouseenter="prepareMenu('menu_Licence')"
onmousedown="event.preventDefault()"
>
<span>Overview</span>
</div>
<div class="off" onmouseleave="leaveMenu('menu_Licence',this)">
<div class="toctree-smilei">
<ul>
<li class="outer">
<a href="licence.html">Licence</a>
</li>
<li class="outer">
<a href="synopsis.html">Synopsis</a>
</li>
<li class="outer">
<a href="highlights.html">Highlights</a>
</li>
<li class="outer">
<a href="releases.html">Releases</a>
</li>
</ul>
</div>
</div>
</div>
<div class="menu" id="menu_Units">
<div id="menuButton_Units" class="menuButton"
onmouseenter="prepareMenu('menu_Units')"
onmousedown="event.preventDefault()"
>
<span>Understand</span>
</div>
<div class="off" onmouseleave="leaveMenu('menu_Units',this)">
<div class="toctree-smilei">
<ul>
<li class="outer">
<a href="units.html">Units</a>
</li>
<li class="outer">
<a href="algorithms.html">PIC algorithms</a>
</li>
<li class="outer">
<a href="parallelization.html">Parallelization basics</a>
</li>
<li class="outer">
<a href="vectorization.html">Vectorization</a>
</li>
<li class="outer">
<a href="collisions.html">Binary collisions</a>
</li>
<li class="outer">
<a href="ionization.html">Ionization</a>
</li>
<li class="outer">
<a href="radiation_loss.html">Synchrotron-like radiation reaction</a>
</li>
<li class="outer">
<a href="multiphoton_Breit_Wheeler.html">Multiphoton Breit-Wheeler pair creation</a>
</li>
<li class="outer">
<a href="laser_envelope.html">Laser envelope model</a>
</li>
<li class="outer">
<a href="relativistic_fields_initialization.html">Field initialization for relativistic species</a>
</li>
</ul>
</div>
</div>
</div>
<div class="menu" id="menu_Install" style="font-weight:bold">
<div id="menuButton_Install" class="menuButton"
onmouseenter="prepareMenu('menu_Install')"
onmousedown="event.preventDefault()"
>
<span>Use</span>
</div>
<div class="off" onmouseleave="leaveMenu('menu_Install',this)">
<div class="toctree-smilei">
<ul>
<li class="outer">
<a href="installation.html">Install</a>
</li>
<li class="outer">
<a href="namelist.html">Write a namelist</a>
</li>
<li class="outer">
<a href="run.html">Run</a>
</li>
<li class="outer">
<a href="post-processing.html">Post-process</a>
</li>
<li >
<a href="#">Contribute</a>
</li>
</ul>
</div>
</div>
</div>
<div class="menu" id="menu_Publications">
<div id="menuButton_Publications" class="menuButton"
onmouseenter="prepareMenu('menu_Publications')"
onmousedown="event.preventDefault()"
>
<span>More</span>
</div>
<div class="off" onmouseleave="leaveMenu('menu_Publications',this)">
<div class="toctree-smilei">
<ul>
<li class="outer">
<a href="material.html">Publications</a>
</li>
<li class="outer">
<a href="partners.html">Partners</a>
</li>
<li class="outer">
<a href="https://smileipic.github.io/tutorials">Smilei tutorials</a>
</li>
</ul>
</div>
</div>
</div>
<script type="text/javascript">
var es=document.getElementsByClassName("menuButton"), i=0;
var evt = "ontouchend" in document ? "touchend" : "click";
for( var i=0; i<es.length; i+=1 ) {
es[i].addEventListener(evt, function(a){ return function(){toggleMenu(a)};}(es[i].parentNode.id));
}
</script>
<div id="searchbox" role="search" style="display:none">
<form class="search" action="search.html" method="get">
<input type="text" name="q" placeholder="Search" id="searchinput" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<div id="searchicon" onclick="openSearch()" style="display:block">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 80 120">
<g transform="translate(0,-932.36216)" >
<circle
r="25" cy="977.51044" cx="38.078663"
style="opacity:1;fill:none;stroke:#ffffff;stroke-width:10;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
transform="matrix(0.36717877,0.93015039,-0.93427297,0.35655858,0,0)"
rx="4.9996676" ry="7.4995141"
y="316.16959" x="947.6142"
height="14.117695" width="46.476151"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;" />
<path
d="m 41.383282,962.25996 a 15,15 0 0 1 11.660107,11.6355"
style="opacity:1;fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>
</div>
<div id="closesearchicon" onclick="closeSearch()" style="display:none">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 80 120">
<g
transform="translate(0,-932.36216)">
<path
d="m 10,962.36216 60,60.00004"
style="fill:none;stroke:#ffffff;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
<path
d="M 70,962.36216 10,1022.3622"
style="fill:none;stroke:#ffffff;stroke-width:10;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
</svg>
</div>
<div id="smallScreenMenuButton" onclick="toggleSmallScreenMenu(event)">
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="-20 -20 140 140">
<g style="fill:#ffffff;stroke:none;">
<circle cx="15" cy="20" r="5" />
<circle cx="35" cy="20" r="5" />
<circle cx="85" cy="20" r="5" />
<rect width="50" height="10" x="35" y="15" rx="0" ry="0" />
<circle cx="15" cy="40" r="5" />
<circle cx="35" cy="40" r="5" />
<circle cx="85" cy="40" r="5" />
<rect width="50" height="10" x="35" y="35" rx="0" ry="0" />
<circle cx="15" cy="60" r="5" />
<circle cx="35" cy="60" r="5" />
<circle cx="85" cy="60" r="5" />
<rect width="50" height="10" x="35" y="55" rx="0" ry="0" />
<circle cx="15" cy="80" r="5" />
<circle cx="35" cy="80" r="5" />
<circle cx="85" cy="80" r="5" />
<rect width="50" height="10" x="35" y="75" rx="0" ry="0" />
</g>
</svg>
</div>
</div>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="material.html" title="Publications"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="post-processing.html" title="Post-process"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Smilei v4.1-163-g011c2ce8 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="contribute">
<h1>Contribute<a class="headerlink" href="#contribute" title="Permalink to this headline">¶</a></h1>
<p>Contributions to the development of <strong class="program">Smilei</strong> are welcome.</p>
<p>To report bugs, please create an issue on the
<a class="reference external" href="https://github.com/SmileiPIC/Smilei/issues/new">GitHub website</a>.</p>
<p>To develop new features, you may freely <em>fork</em>
the source code from the same website. When
your modifications to the code are ready, you can make a <a class="reference external" href="https://github.com/SmileiPIC/Smilei/pulls">pull request</a> for review and
merge with the main repository.</p>
<p>Guidelines for new developments are:</p>
<ul class="simple">
<li>Write clear, commented code, or self-explanatory.</li>
<li>Write the documentation corresponding to the new features, if any.</li>
<li>Make validation cases, and reference data, corresponding to the added features.</li>
</ul>
<hr class="docutils" />
<div class="section" id="write-documentation">
<h2>Write documentation<a class="headerlink" href="#write-documentation" title="Permalink to this headline">¶</a></h2>
<p>The documentation you are currently reading is written in the
<a class="reference external" href="www.sphinx-doc.org/en/stable/rest.html">reStructuredText</a> (rST) language, and included
in the main <strong class="program">Smilei</strong> repository. This is a fairly simple markup language. You
can see examples from the source files, which are located in the
<code class="docutils literal notranslate"><span class="pre">doc/Sphinx</span></code> folder and have the extension <code class="docutils literal notranslate"><span class="pre">.rst</span></code>.</p>
<p>To transform it into an <em>html</em> website, it is
processed using the <a class="reference external" href="www.sphinx-doc.org">sphinx</a> python package that you may have to
install.
If you have sphinx installed, you may simply go to the
main <strong class="program">Smilei</strong> folder from a command line terminal, then run the command</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>make doc
</pre></div>
</div>
<p>This creates a local <em>html</em> website accessible in the <code class="docutils literal notranslate"><span class="pre">build/html/</span></code> folder. Simply
open the <code class="docutils literal notranslate"><span class="pre">build/html/index.html</span></code> file in your favorite web browser.</p>
<p>To document a new feature, please modify the file <code class="docutils literal notranslate"><span class="pre">namelist.rst</span></code> to indicate the
syntax changes in the input file. If the feature requires detailed physical or numerical
background, you may add a new page in the “Understand” section of the website.
To do that, create a new <code class="docutils literal notranslate"><span class="pre">.rst</span></code> file, then reference it in the table of contents
located in <code class="docutils literal notranslate"><span class="pre">index.rst</span></code>.</p>
<hr class="docutils" />
</div>
<div class="section" id="validate-your-changes">
<span id="validation"></span><h2>Validate your changes<a class="headerlink" href="#validate-your-changes" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">Smilei</strong> has a system of test cases combined with reference results that must be
validated, ideally, for every <em>push</em> submitted to the git repository.
These <strong>test cases</strong> are located in the <code class="docutils literal notranslate"><span class="pre">benchmarks/</span></code> folder.</p>
<p>Each benchmark has an associated <strong>validation file</strong>, written in <em>python</em>, which contains
instructions on how to produce an analysis of the results that can validate that particular
benchmark. The validation files are located in the <code class="docutils literal notranslate"><span class="pre">validation/analyses/</span></code> folder.
They have the same name as the benchmarks, with the prefix <code class="docutils literal notranslate"><span class="pre">validate_</span></code>.</p>
<p>Once a benchmark has been run, the corresponding <code class="docutils literal notranslate"><span class="pre">validate_*</span></code> file is run in <em>python</em>
to compare the analysis results with a <strong>reference file</strong> located in the folder
<code class="docutils literal notranslate"><span class="pre">validation/references/</span></code>. Note that the analysis produced by the <code class="docutils literal notranslate"><span class="pre">validate_*</span></code> file
can also be used to generate the reference file the first time.</p>
<p><strong>When you code a new feature, you must provide a new benchmark, the corresponding
analysis and reference file</strong></p>
<p>To make this process easier, a <em>python</em> script is available.</p>
<p class="rubric">How do I use the <code class="docutils literal notranslate"><span class="pre">validation.py</span></code> script?</p>
<p>The script <code class="docutils literal notranslate"><span class="pre">validation/validation.py</span></code> can do three things:</p>
<ul class="simple">
<li>generate validation reference(s) for given benchmark(s)</li>
<li>compare benchmark(s) to their reference(s)</li>
<li>show visually differences between benchmark(s) and their reference(s)</li>
</ul>
<p>Usage:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python validation.py <span class="o">[</span>-c<span class="o">]</span> <span class="o">[</span>-h<span class="o">]</span> <span class="o">[</span>-v<span class="o">]</span> <span class="o">[</span>-o <nOMP><span class="o">]</span> <span class="o">[</span>-m <nMPI><span class="o">]</span> <span class="o">[</span>-b <bench> <span class="o">[</span>-g <span class="p">|</span> -s<span class="o">]]</span> <span class="o">[</span>-r <nRestarts><span class="o">]</span>
</pre></div>
</div>
<ul>
<li><div class="first line-block">
<div class="line">Option <code class="docutils literal notranslate"><span class="pre">-b</span> <span class="pre"><bench></span></code>:</div>
<div class="line"><code class="docutils literal notranslate"><span class="pre"><bench></span></code> : benchmark(s) to validate. Accepts wildcards.</div>
<div class="line"><code class="docutils literal notranslate"><span class="pre"><bench>=?</span></code> : ask input for a benchmark</div>
<div class="line">DEFAULT : All benchmarks are validated.</div>
</div>
</li>
<li><div class="first line-block">
<div class="line">Option <code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre"><nOMP></span></code>:</div>
<div class="line"><code class="docutils literal notranslate"><span class="pre"><nOMP></span></code> : number of OpenMP threads used for the execution</div>
<div class="line">DEFAULT : 4</div>
</div>
</li>
<li><div class="first line-block">
<div class="line">Option <code class="docutils literal notranslate"><span class="pre">-m</span> <span class="pre"><nMPI></span></code>:</div>
<div class="line"><code class="docutils literal notranslate"><span class="pre"><nMPI></span></code> : number of MPI processes used for the execution</div>
<div class="line">DEFAULT : 4</div>
</div>
</li>
<li><p class="first">Option <code class="docutils literal notranslate"><span class="pre">-g</span></code>: Generation of references only (no validation)</p>
</li>
<li><p class="first">Option <code class="docutils literal notranslate"><span class="pre">-s</span></code>: Plot differences with references only (no validation)</p>
</li>
<li><p class="first">Option <code class="docutils literal notranslate"><span class="pre">-c</span></code>: Compilation only (no run, no validation)</p>
</li>
<li><p class="first">Option <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre"><nRrestarts></span></code>: Force the simulation to be broken in several restarts.</p>
</li>
<li><p class="first">Option <code class="docutils literal notranslate"><span class="pre">-v</span></code>: Verbose</p>
</li>
<li><p class="first">Option <code class="docutils literal notranslate"><span class="pre">-h</span></code>: Help</p>
</li>
</ul>
</div></blockquote>
<p>Exit status of the script:</p>
<blockquote>
<div><ul class="simple">
<li>0 validated</li>
<li>1 validation fails</li>
<li>2 execution fails</li>
<li>3 compilation fails</li>
<li>4 bad option</li>
</ul>
</div></blockquote>
<p>Examples:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>./validation.py -v
</pre></div>
</div>
<p>Compiles and validates all cases in verbose mode.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>./validation.py -v -b tst1d_00_em_propagation.py
</pre></div>
</div>
<p>Validates only the benchmark <code class="docutils literal notranslate"><span class="pre">tst1d_00_em_propagation.py</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>./validation.py -v -b tst1d_00_em_propagation.py -g
</pre></div>
</div>
<p>Generates the reference file for the benchmark <code class="docutils literal notranslate"><span class="pre">tst1d_00_em_propagation.py</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>./validation.py -v -b tst1d_00_em_propagation.py -s
</pre></div>
</div>
<p>Runs the benchmark <code class="docutils literal notranslate"><span class="pre">tst1d_00_em_propagation.py</span></code>, and plots the differences with the reference file.</p>
</div></blockquote>
<p class="rubric">What does <code class="docutils literal notranslate"><span class="pre">validation.py</span></code> actually do?</p>
<p>It creates a new <code class="docutils literal notranslate"><span class="pre">validation/workdirs</span></code> directory (that may be freely deleted later).</p>
<p>It compiles the code:</p>
<blockquote>
<div>If the “workdirs” directory lacks a smilei binary, or it is too old,
then the “workdirs” is backed up, and a new compilation occurs.
The compilation output is logged in <code class="docutils literal notranslate"><span class="pre">compilation_output</span></code>.
If compiling errors occur, <code class="docutils literal notranslate"><span class="pre">compilation_errors</span></code> is created and the script exits with status 3.</div></blockquote>
<p>It runs each benchmark:</p>
<blockquote>
<div><p>If the directory <code class="docutils literal notranslate"><span class="pre">wd_<benchmark>/<o>/<m></span></code> does not exist then:</p>
<ul class="simple">
<li>it is created.</li>
<li><code class="docutils literal notranslate"><span class="pre">smilei</span></code> is executed in that directory for the requested benchmark.</li>
<li>if execution fails, the script exits with status 2.</li>
</ul>
</div></blockquote>
<p>It analyses the results (for each requested benchmark) using the <code class="docutils literal notranslate"><span class="pre">validate_*</span></code> script:</p>
<blockquote>
<div><ul class="simple">
<li>If requested to compare to previous references (default option), the analysis
is compared to the reference data.</li>
<li>If requested to generate references (option <code class="docutils literal notranslate"><span class="pre">-g</span></code>), the analysis is stored
as reference data.</li>
<li>If requested to show differences to previous references (option <code class="docutils literal notranslate"><span class="pre">-s</span></code>),
the analysis is plotted vs. the reference data.</li>
</ul>
</div></blockquote>
<p class="rubric">How should I make the <code class="docutils literal notranslate"><span class="pre">validate_*</span></code> script?</p>
<p>The <code class="docutils literal notranslate"><span class="pre">validate_*</span></code> script should load the simulation results using whatever means suits
the benchmark the best. In many cases, the <a class="reference internal" href="post-processing.html"><span class="doc">happi</span></a> module is
employed to extract diagnostics results.</p>
<p>Any <em>python</em> instructions may be used to process the simulation results. Once the data
has been crunched into a meaningful value, string, or array, then it must be passed to the
following predefined function:</p>
<dl class="method">
<dt id="Validate">
<code class="descname">Validate</code><span class="sig-paren">(</span><em>description</em>, <em>data</em>, <em>epsilon</em><span class="sig-paren">)</span><a class="headerlink" href="#Validate" title="Permalink to this definition">¶</a></dt>
<dd><ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">description</span></code>: a string describing the data</li>
<li><code class="docutils literal notranslate"><span class="pre">data</span></code>: a float, a <em>numpy</em> float array, or any other python data</li>
<li><code class="docutils literal notranslate"><span class="pre">epsilon</span></code> (optional): acceptable difference between data and reference</li>
</ul>
</dd></dl>
<p>The <code class="docutils literal notranslate"><span class="pre">data</span></code> passed to this function constitutes the <em>analysis</em> that is compared to previous
reference files. It is the same analysis that is used to generate those reference files
in the first place.</p>
</div>
</div>
</div></div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="material.html" title="Publications"
>next</a> |</li>
<li class="right" >
<a href="post-processing.html" title="Post-process"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Smilei v4.1-163-g011c2ce8 documentation</a> »</li>
</ul>
</div>
<div class="footer">
<div>
<a href="site.html">Site index</a>
</div>
<div>
Last updated on Jan 31, 2019
</div>
<div>
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.3</a>
</div>
</div>
<script type="text/javascript">
var nav = document.getElementById("nav");
var nav_list = document.getElementById("nav_list");
var nav_button = document.getElementById("nav_button");
var smallScreenMenu = document.getElementById("smallScreenMenu");
var smallScreenMenuButton = document.getElementById("smallScreenMenuButton");
var searchicon = document.getElementById("searchicon");
var searchbox = document.getElementById("searchbox");
var searchinput= document.getElementById("searchinput");
var menus = document.getElementsByClassName("menu");
for( var i=0; i<menus.length; i++ )
menus[i].active = false;
var ul = nav_list.getElementsByTagName("ul")[0], li;
var keep_nav = false;
if( ul ) {
li = ul.firstElementChild;
if( li ) {
if( li.getElementsByTagName("ul").length > 0 ) keep_nav = true;
}
}
if( keep_nav ) {
li.removeChild( li.firstElementChild );
} else {
document.getElementById("nav_positioner").removeChild( document.getElementById("nav") );
}
function navOff() {
nav_list.style.display = "none";
nav_button.className = "";
nav.style.overflowY = "visible";
}
function toggleNav() {
for( var i=0; i<menus.length; i++ )
menuOff( menus[i] );
if( nav_list.style.display != "inline-block" ) {
nav_list.style.display = "inline-block";
nav_button.className = "pushed";
nav.style.overflowY = "auto";
} else {
navOff();
}
}
function toggleSmallScreenMenu(e) {
e.preventDefault();
if( smallScreenMenu.className != "on" ) {
smallScreenMenu.className = "on";
smallScreenMenuButton.className = "pushed";
} else {
smallScreenMenu.className = "off";
smallScreenMenuButton.className = "";
}
}
function prepareMenu(menu_id) {
var menu = document.getElementById(menu_id);
menu.timer1 = setTimeout(function(a){ return function(){thisMenuOnly(a)};}(menu_id), 100);
menu.addEventListener("mouseleave", function(a){ return function(){clearTimeout(a.timer1)};}(menu) );
}
function leaveMenu(menu_id, source) {
var menu = document.getElementById(menu_id);
menu.timer2 = setTimeout(function(a){ return function(){menuOff(a)};}(menu), 1000);
source.addEventListener("mouseenter", function(a){ return function(){clearTimeout(a.timer2)};}(menu) );
}
function menuOn( menu ) {
var divs = menu.getElementsByTagName("div");
if(nav_list) navOff();
divs[1].className = "on";
divs[0].className = "menuButton pushed";
menu.active = true;
}
function menuOff( menu ) {
var divs = menu.getElementsByTagName("div");
divs[1].className = "off";
divs[0].className = "menuButton";
menu.active = false;
}
function thisMenuOnly(menu_id) {
var menu = document.getElementById(menu_id);
for( var i=0; i<menus.length; i++ )
if( i!=menu_id )
menuOff( menus[i] );
menuOn( menu );
}
function toggleMenu(menu_id) {
var menu = document.getElementById(menu_id);
if( menu.active ) {
menuOff( menu );
} else {
for( var i=0; i<menus.length; i++ )
if( i!=menu_id )
menuOff( menus[i] );
menuOn( menu );
}
}
function openSearch() {
for( var i=0; i<menus.length; i++ ) {
menuOff( menus[i] );
menus[i].style.zIndex = "-1";
}
searchicon.style.display = "none";
closesearchicon.style.display = "block";
searchbox.style.display = "block";
searchinput.focus();
}
function closeSearch() {
searchicon.style.display = "block";
closesearchicon.style.display = "none";
searchbox .style.display = "none";
for( var i=0; i<menus.length; i++ )
menus[i].style.zIndex = "0";
}
var documentDiv = document.getElementsByClassName("document")[0];
documentDiv.addEventListener('click', function (event) {
if(nav_list) navOff();
for( var i=0; i<menus.length; i++ )
menuOff( menus[i] );
});
</script>
</body>
</html>