Ignore:
Timestamp:
Feb 8, 2015, 9:20:45 PM (9 years ago)
Author:
alain
Message:

1) Introduce distributed barriers in the multi-threads applications
(classif) transpose, convol, sort, gameoflife)

2) Introducing support for architectures containing empty clusters
in the mapping of these multi-threaded applications.

3) Removing the "command line arguments" in the sort application
(replaced by the giet_procs_number() system call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/sort/sort.py

    r434 r502  
    3333    # define vsegs base & size
    3434    code_base  = 0x10000000
    35     code_size  = 0x00200000     # 2 Mbytes (replicated in each cluster)
     35    code_size  = 0x00010000     # 64 Kbytes (replicated in each cluster)
    3636
    3737    data_base  = 0x20000000
    38     data_size  = 0x00100000     # 1 Mbyte (non replicated)
    39 
    40     args_base  = 0x20100000
    41     args_size  = 0x00000004     # 4 bytes (non replicated)
     38    data_size  = 0x00010000     # 64 Kbyte (non replicated)
    4239
    4340    stack_base = 0x40000000
     
    5451                     'C_WU', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM',
    5552                     binpath = 'build/sort/sort.elf',
    56                      local = False, big = True )
    57 
    58     # args vseg : non local (only in cluster[0,0])
    59     mapping.addVseg( vspace, 'sort_args', args_base , args_size,
    60                      'C_WU', vtype = 'CONST', x = 0, y = 0, pseg = 'RAM',
    61                      init = ntasks,
    62                      local = False, big = True )
     53                     local = False )
    6354
    6455    # code vsegs : local (one copy per cluster)
    6556    for x in xrange (x_size):
    6657        for y in xrange (y_size):
    67             mapping.addVseg( vspace, 'sort_code', code_base , code_size,
    68                              'CXWU', vtype = 'ELF', x = x, y = y, pseg = 'RAM',
    69                              binpath = 'build/sort/sort.elf',
    70                              local = True, big = True )
     58            cluster_id = (x * y_size) + y
     59            if ( mapping.clusters[cluster_id].procs ):
     60
     61                mapping.addVseg( vspace, 'sort_code', code_base , code_size,
     62                                 'CXWU', vtype = 'ELF', x = x, y = y, pseg = 'RAM',
     63                                 binpath = 'build/sort/sort.elf',
     64                                 local = True )
    7165
    7266    # stacks vsegs : local (one stack per task)
    7367    for x in xrange (x_size):
    7468        for y in xrange (y_size):
    75             for p in xrange (nprocs):
    76                 proc_id = (((x * y_size) + y) * nprocs) + p
    77                 size    = stack_size / nprocs
    78                 base    = stack_base + (proc_id * size)
    79                 mapping.addVseg( vspace, 'sort_stack_%d_%d_%d' % (x,y,p), base, size,
     69            cluster_id = (x * y_size) + y
     70            if ( mapping.clusters[cluster_id].procs ):
     71                for p in xrange (nprocs):
     72                    proc_id = (((x * y_size) + y) * nprocs) + p
     73                    size    = stack_size / nprocs
     74                    base    = stack_base + (proc_id * size)
     75
     76                    mapping.addVseg( vspace, 'sort_stack_%d_%d_%d' % (x,y,p),
     77                                     base, size, 'C_WU', vtype = 'BUFFER',
     78                                     x = x, y = y, pseg = 'RAM',
     79                                     local = True, big = True )
     80
     81    # heap vsegs : distributed but non local (all tasks can access all heap vsegs)
     82    for x in xrange (x_size):
     83        for y in xrange (y_size):
     84            cluster_id = (x * y_size) + y
     85            if ( mapping.clusters[cluster_id].procs ):
     86                size       = heap_size
     87                base       = heap_base + (cluster_id * size)
     88
     89                mapping.addVseg( vspace, 'sort_heap_%d_%d' % (x,y), base, size,
    8090                                 'C_WU', vtype = 'BUFFER', x = x, y = y, pseg = 'RAM',
    81                                  local = True, big = True )
    82 
    83             # heap vsegs : distributed but non local (all tasks can access all heap vsegs)
    84             cluster_id = (x * y_size) + y
    85             size       = heap_size
    86             base       = heap_base + (cluster_id * size)
    87             mapping.addVseg( vspace, 'sort_heap_%d_%d' % (x,y), base, size,
    88                              'C_WU', vtype = 'BUFFER', x = x, y = y, pseg = 'RAM',
    89                              local = False, big = True )
     91                                 local = False, big = True )
    9092
    9193    # distributed tasks / one task per processor
    9294    for x in xrange (x_size):
    9395        for y in xrange (y_size):
    94             for p in xrange( nprocs ):
    95                 trdid = (((x * y_size) + y) * nprocs) + p
    96                 mapping.addTask( vspace, 'sort_%d_%d_%d' % (x,y,p), trdid, x, y, p,
    97                                  'sort_stack_%d_%d_%d' % (x,y,p),
    98                                  'sort_heap_%d_%d' % (x,y), 0 )
     96            cluster_id = (x * y_size) + y
     97            if ( mapping.clusters[cluster_id].procs ):
     98                for p in xrange( nprocs ):
     99                    trdid = (((x * y_size) + y) * nprocs) + p
     100
     101                    mapping.addTask( vspace, 'sort_%d_%d_%d' % (x,y,p),
     102                                     trdid, x, y, p,
     103                                     'sort_stack_%d_%d_%d' % (x,y,p),
     104                                     'sort_heap_%d_%d' % (x,y), 0 )
    99105
    100106    # extend mapping name
Note: See TracChangeset for help on using the changeset viewer.