Skip to content

Commit ded2190

Browse files
jmorice91JAuriac
andauthored
Redefine the call of share and reclaim (#41)
* fix #33, add remarks in the README * fix #33, update the order share/reclaim * Update README.md Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com> * Update README.md Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com> * Update README.md Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com> * Update README.md Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com> * Update README.md Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com> * Fix indent and improve README.md * remove unnecessary remark * indent as pdi with improvement * update copyright and indent of multi expose * Update README.md Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com> --------- Co-authored-by: JAuriac <56091659+JAuriac@users.noreply.github.com>
1 parent 8adf268 commit ded2190

18 files changed

Lines changed: 3317 additions & 3119 deletions

File tree

README.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ in two distinct groups `iter1` and `iter2`.
378378
To see your `h5` file in readable file format, you can check the section
379379
[Comparison with the `h5dump` command](#compare_h5_h5dump).
380380

381-
382381
### Ex6. Simplifying the code
383382

384383
As you can notice, the %PDI code is quite redundant.
@@ -391,6 +390,9 @@ the comparison between logs.
391390
* Examine the source code, compile it and run it.
392391

393392
\remark At the end of the iteration loop, a new event `finalization` is added.
393+
To gain a better understanding of the information provided by the trace plugin,
394+
the call order of different `::PDI_share` is changed in the ex6 after the main
395+
loop.
394396

395397
There are lots of matched `::PDI_share`/`::PDI_reclaim` in the code.
396398

@@ -422,12 +424,33 @@ In summary:
422424
`::PDI_share` + `::PDI_event` + `::PDI_reclaim`.
423425

424426
3. `::PDI_multi_expose` for data `A` and data `B` is equivalent to
425-
`::PDI_share` `A` + `::PDI_share` `B`+ `::PDI_event` + `::PDI_reclaim` `B`
426-
+ `::PDI_reclaim` `A`.
427+
`::PDI_share` `A` + `::PDI_share` `B`+ `::PDI_event` + `::PDI_reclaim` `B` + `::PDI_reclaim` `A`.
427428

428429
\attention
429430
The `::PDI_multi_expose` is implemented with interlaced share/reclaim pairs.
430431

432+
\attention
433+
When we used `::PDI_multi_expose` with multiple data, the order of appearance
434+
of the arguments of the function corresponds to the order of the `::PDI_share`.
435+
436+
\attention
437+
In a `::PDI_multi_expose` if you have a data1 that depends on the data2,
438+
you need to pass the arguments corresponding to data2 before the arguments
439+
corresponding to data1 in this function. With `::PDI_share` and
440+
`::PDI_reclaim` functions, you need to share data2 before data1.
441+
For example, a vector `V` that depends on its size `N`:
442+
```C
443+
PDI_multi_expose("save_vector_V",
444+
"size_of_vector", &N, PDI_OUT,
445+
"vector_V", V, PDI_OUT,
446+
NULL);
447+
```
448+
```C
449+
PDI_share("size_of_vector", &N, PDI_OUT)
450+
PDI_share("vector_V", V, PDI_OUT)
451+
PDI_reclaim("size_of_vector")
452+
PDI_reclaim("vector_V")
453+
```
431454
### Ex7. Writing a selection
432455

433456
In this exercise, you will only write a selection of the 2D array in memory
@@ -644,9 +667,9 @@ defined in `ex11.c`.
644667
and `::PDI_release` are called (see \ref annotation "Code annotation").
645668
For example,
646669
```c
647-
int *iter;
648-
PDI_access("ii", (void **)&iter, PDI_IN);
649-
PDI_release("ii");
670+
int *iter;
671+
PDI_access("ii", (void **)&iter, PDI_IN);
672+
PDI_release("ii");
650673
```
651674
`::PDI_access` sets our pointer (`iter`) to the data location of `ii`.
652675
We need to pass `PDI_IN` because data flows from PDI to our application.

0 commit comments

Comments
 (0)