1- \page Hands_on Hands-on tutorial
1+ # Hands-on tutorial {#Hands_on}
22
33In this tutorial, you will build a PDI-enabled application step-by-step from a
44PDI-free base.
@@ -9,19 +9,19 @@ You will end-up building the C version of the
99Additional [ examples are available for the other plugins] ( https://gitlab.maisondelasimulation.fr/pdidev/pdi/-/tree/master/example ) .
1010
1111
12- # Setup
12+ ## Setup
1313
1414\attention
1515To run this hands-on tutorial, you first need to \ref Installation "install PDI"
1616and setup your environment.
1717
18- ## PDI installation
18+ ### PDI installation
1919
2020\ref Installation "PDI installation" is documented in a
2121\ref Installation "dedicated page".
2222
2323
24- ## Hands-on tutorial setup
24+ ### Hands-on tutorial setup
2525
2626Once %PDI is installed, you can proceed with getting the sources for the
2727hands-on tutorial from [ github] ( https://github.com/pdidev/tutorial ) :
@@ -31,7 +31,7 @@ cd tutorial
3131```
3232
3333
34- ## Compilation
34+ ### Compilation
3535
3636Before compilation, configure the tutorial by detecting all dependencies:
3737``` bash
@@ -49,7 +49,7 @@ make ex?
4949Where ` ? ` is the number of the exercise.
5050
5151
52- ## Execution
52+ ### Execution
5353
5454You can run each exercise with the following command:
5555``` bash
@@ -67,9 +67,9 @@ example for ex2.):
6767Now you're ready to work, ** good luck** !
6868
6969
70- # PDI-free code
70+ ## PDI-free code
7171
72- ## Ex1. Getting started
72+ ### Ex1. Getting started
7373
7474Ex1. implements a simple heat equation solver using an explicit forward finite
7575difference scheme parallelized with MPI.
@@ -113,9 +113,9 @@ srun -n 4 ./ex1
113113```
114114
115115
116- # PDI core & trace plugin
116+ ## PDI core & trace plugin
117117
118- ## Ex2. Now with some PDI
118+ ### Ex2. Now with some PDI
119119
120120Ex2. is the same code as that of ex1. with %PDI calls added in ` main ` function.
121121In our YAML file (` ex2.yml ` ), a new sub-tree has been added under the ` pdi ` key.
@@ -139,9 +139,9 @@ Is one better than the other?
139139If you do not know the answer to this question, just wait until Ex5. :)
140140
141141
142- # Decl'HDF5 plugin
142+ ## Decl'HDF5 plugin
143143
144- ## Ex3. HDF5 through PDI
144+ ### Ex3. HDF5 through PDI
145145
146146In this exercise, the code is the same as in ex2.
147147No need to touch the C code here, modification of the YAML file (` ex3.yml ` )
@@ -180,7 +180,7 @@ Since we write to the same location independently of the MPI rank, this exercise
180180will fail if more than one MPI rank is used.
181181
182182
183- ## Ex4. Writing some real data
183+ ### Ex4. Writing some real data
184184
185185In this exercise each MPI process will write its local 2D array block contained
186186in the ` main_field ` variable to a separate HDF5 file.
@@ -216,7 +216,7 @@ condition to restrict its output.
216216 expected content as described in ` ex4.h5dump ` .
217217
218218
219- ## Ex5. Introducing events
219+ ### Ex5. Introducing events
220220
221221In ex4., two variables were written to ` ex4-data*.h5 ` , but the file was opened
222222and closed for each and every write.
@@ -246,7 +246,7 @@ You have to use events for that, you will modify both the C and YAML file.
246246 Your output should match the content described in ` ex5.h5dump ` .
247247
248248
249- ## Ex6. Simplifying the code
249+ ### Ex6. Simplifying the code
250250
251251As you can notice, the %PDI code is quite redundant.
252252In this exercise, you will use ` ::PDI_expose ` and ` ::PDI_multi_expose ` to
@@ -275,7 +275,7 @@ then triggers an event and finally does all the reclaim in reverse order.
275275```
276276
277277
278- ## Ex7. Writing a selection
278+ ### Ex7. Writing a selection
279279
280280In this exercise, you will only write a selection of the 2D array in memory
281281excluding ghosts to the HDF5 file.
@@ -300,7 +300,7 @@ the selection of data from memory to write.
300300![ graphical representation] ( PDI_hdf5_selection.jpg )
301301
302302
303- ## Ex8. Selecting on the dataset size
303+ ### Ex8. Selecting on the dataset size
304304
305305In this exercise, you will once again change the YAML file to handle a selection
306306in the dataset in addition to the selection in memory from the previous
@@ -329,9 +329,9 @@ the selection where to write in the file dataset.
329329![ graphical representation] ( PDI_hdf5_selection_advanced.jpg )
330330
331331
332- # parallel Decl'HDF5
332+ ## parallel Decl'HDF5
333333
334- ## Ex9. Going parallel
334+ ### Ex9. Going parallel
335335
336336Running the code from the previous exercises in parallel should already work and
337337yield one file per process containing the local data block.
@@ -366,9 +366,9 @@ of processes used. You can easily check if the files are the same by running:
366366![ graphical representation of the parallel I/O] ( PDI_hdf5_parallel.jpg )
367367
368368
369- # Pycall
369+ ## Pycall
370370
371- ## Ex10. Post-processing the data in python
371+ ### Ex10. Post-processing the data in python
372372
373373In this exercise, you will once again modify the YAML file only and use python
374374to post-process the data in situ before writing it to HDF5.
@@ -407,7 +407,7 @@ In a more realistic setup, one would typically not write much code in the YAML
407407file directly, but would instead call functions specified in a ` .py ` file on
408408the side.
409409
410- # What next ?
410+ ## What next ?
411411
412412In this tutorial, you used the C API of %PDI and from YAML, you used the
413413\ref trace_plugin "Trace", \ref Decl_HDF5_plugin "Decl'HDF5", and
0 commit comments