| 1 | |
| 2 | The [source:trunk/soft/giet_vm/giet_libs/barrier.c barrier.c] and [source:trunk/soft/giet_vm/giet_libs/barrier.h barrier.h] |
| 3 | files define a synchronisation service between several |
| 4 | tasks sharing the same address space in a parallel multi-tasks application. |
| 5 | |
| 6 | There is actually two types of barriers: |
| 7 | 1. The "giet_barrier_t" is a simple sense-reversing barrier. It can be safely used several times (in a loop for example), |
| 8 | but it does not scale, and should not be used when the number of expected tasks is larger than few tens. |
| 9 | The available functions are: |
| 10 | * '''barrier_init( giet_barrier_t * barrier, unsigned int ntasks )‘‘‘ |
| 11 | * '''barrier_wait( giet_barrier_t * barrier )''' |
| 12 | 1. The ''giet_sbt_barrier_t" can be used in multi-clusters architectures, and is implemented as a physically distributed Sliced-Binary-Tree (SBT). |
| 13 | To use this distributed barrier, some placement constraints must be respected: |
| 14 | * The number of tasks must be a power of 2. |
| 15 | * There is one task per processor in a given cluster. |
| 16 | * The involved clusters form a mesh[X][Y] where (X = Y) or (x = 2*Y) |
| 17 | * The lower left involved cluster is cluster(0,0) |
| 18 | |
| 19 | Neither the barrier_init(), nor the barrier_wait() function require a syscall. |
| 20 | For both types of barriers, the barrier initialisation should be done by one single task. |
| 21 | |