Changes between Initial Version and Version 1 of kernel_barriers


Ignore:
Timestamp:
Jan 19, 2015, 8:23:49 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_barriers

    v1 v1  
     1= GIET-VM / Barriers access functions =
     2
     3[[PageOutline]]
     4
     5The [source:soft/giet_vm/giet_common/kernel_barriers.c kernel_barriers.c] and [source:soft/giet_vm/giet_common/kernel_barriers.h kernel_barriers.h] files define the functions used by the kernel to
     6accesss synchronisation barriers between several concurrent tasks.
     7
     8The GIET_VM kernel define two types of barriers:
     9
     10 1. The '''simple_barrier_t''' implements a non-distributed toggle barrier. the number of expected tasks can be defined by the software. It can be safely used several times.
     11
     12 2. The '''sqt_barrier_t''' is physically distributed on all clusters, and is intended to avoid contention on a single cluster  when a barrier is shared by a large number of tasks. It is implemented as a Synchronisation Quad Tree (SQT). For now, the number of expected tasks is defined by the number of processors specified in the mapping, and we use the smallest SQT covering all processors.
     13
     14All access functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.
     15
     16The '''simple_barrier_t''' and '''sqt_barrier_t''', structures are implemented to have one single barrier in a 64 bytes cache line, and should be aligned on a cache line boundary.
     17
     18
     19== Simple barrier access functions ==
     20
     21 === void '''_simple_barrier_init'''( simple_barrier_t * barrier,  unsigned int ntasks ) ===
     22This function initialises the barrier.
     23 * '''barrier''' pointer on the barrier
     24 * '''ntasks''' number of expected tasks.
     25
     26 === void '''_simple_barrier_wait'''( simple_barrier_t * barrier ) ===
     27This function is blocking until all expected tasks reached the barrier.
     28It uses a toggle condition to avoid race conditions when the same barrier is used several times.
     29It uses the _atomic_increment() kernel function to compute the number of arrived tasks.
     30
     31
     32
     33== Distributed barrier access functions ==
     34
     35 === void '''_sqt_barrier_init'''( sqt_barrier_t*   barrier ) ===
     36This function allocates and initialises the distributed SQT barrier nodes on clusters. The number of expected tasks is defined by the NB_TOTAL_PROCS parameter defined in the ''hard_config.h'' file.
     37The SBT footprint is computed to cover all clusters containing processors in the 2D mash (X_SIZE / Y_SIZE). The SQT can be "uncomplete" as SQT barrier nodes are only build in clusters
     38containing processors.
     39The actual number of SQT barriers nodes in a cluster[x][y] depends on (x,y). Ther is at least 1 node / at most 5 nodes per cluster:
     40 * barrier node arbitrating between all processors of   1 cluster  has level 0,
     41 * barrier node arbitrating between all processors of   4 clusters has level 1,
     42 * barrier node arbitrating between all processors of  16 clusters has level 2,
     43 * barrier node arbitrating between all processors of  64 clusters has level 3,
     44 * barrier node arbitrating between all processors of 256 clusters has level 4,
     45 This function uses the _remote_malloc() function, and the distributed kernel heap segments.
     46
     47 === void '''_sqt_barrier_wait'''( sqt_lock_t*  barrier ) ===
     48This function is blocking until all expected tasks reached the barrier.
     49It uses a toggle condition to avoid race conditions when the same barrier is used several times.
     50It uses the _atomic_increment() kernel function to compute the number of arrived tasks.
     51
     52