Ignore:
Timestamp:
Mar 14, 2016, 3:11:45 PM (8 years ago)
Author:
alain
Message:

Introducing a port of ocean application without macros.

File:
1 edited

Legend:

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

    r610 r799  
    4242    data_size  = 0x00020000     # 128 Kbytes (non replicated)
    4343   
    44     ldata_base = 0x20200000     # 16 Ko (per cluster)
    45     ldata_size = 0x00004000
    46 
    4744    stack_base = 0x40000000
    48     stack_size = 0x00200000     # 2 Mbytes (per cluster)
     45    stack_size = 0x00010000     # 64 Kbytes (per thread)
    4946
    5047    heap_base  = 0x60000000
    51     heap_size  = 0x08000000     # 128 Mbytes (per cluster)
     48    heap_size  = 0x02000000     # 32 Mbytes (per cluster)
    5249
    5350    # create vspace
    54     vspace = mapping.addVspace( name = 'ocean', startname = 'ocean_data' )
     51    vspace = mapping.addVspace( name = 'ocean', startname = 'ocean_data' , active = True )
    5552   
    5653    # data vseg : shared (only in cluster[0,0])
     
    7976                for p in xrange( nprocs ):
    8077                    proc_id = (((x * y_size) + y) * nprocs) + p
    81                     size    = (stack_size / nprocs) & 0xFFFFF000
    82                     base    = stack_base + (proc_id * size)
     78                    size    = stack_size - 4096
     79                    base    = stack_base + (proc_id * stack_size)
    8380
    8481                    mapping.addVseg( vspace, 'ocean_stack_%d_%d_%d' % (x,y,p),
    8582                                     base, size, 'C_WU', vtype = 'BUFFER',
    8683                                     x = x , y = y , pseg = 'RAM',
    87                                      local = True, big = True )
     84                                     local = True )
    8885
    8986    # heap vsegs: distributed non local (all heap vsegs can be accessed by all tasks)
     
    9996                                 local = False, big = True )
    10097
    101     # Local data vsegs: local (one copy in each cluster)
    102     for x in xrange (x_size):
    103         for y in xrange (y_size):
    104             cluster_id = (x * y_size) + y
    105             if ( mapping.clusters[cluster_id].procs ):
    106 
    107                 mapping.addVseg( vspace, 'ocean_ldata_%d_%d' % (x,y), ldata_base, ldata_size,
    108                                  'C_WU', vtype = 'BUFFER', x = x, y = y, pseg = 'RAM',
    109                                  local = True )
    110 
    111     # distributed tasks / one task per processor
     98    # distribute one thread per processor / main on P[0,0,0]
    11299    for x in xrange (x_size):
    113100        for y in xrange (y_size):
     
    115102            if ( mapping.clusters[cluster_id].procs ):
    116103                for p in xrange( nprocs ):
    117                     trdid = (((x * y_size) + y) * nprocs) + p
    118                     if x == 0 and y == 0 and p == 0 :
    119                         startid=0
    120                     else :
     104                    if x == 0 and y == 0 and p == 0 :    # main
    121105                        startid = 1
     106                        is_main = True
     107                    else :                               # slaves
     108                        startid = 0
     109                        is_main = False
    122110                   
    123                     mapping.addTask( vspace, 'ocean_%d_%d_%d' % (x,y,p),
    124                                      trdid, x, y, p,
    125                                      'ocean_stack_%d_%d_%d' % (x,y,p),
    126                                      'ocean_heap_%d_%d' % (x,y), startid )
     111                    mapping.addThread( vspace,
     112                                       'ocean_%d_%d_%d' % (x,y,p),
     113                                       is_main,
     114                                       x, y, p,
     115                                       'ocean_stack_%d_%d_%d' % (x,y,p),
     116                                       'ocean_heap_%d_%d' % (x,y),
     117                                       startid )
    127118
    128119    # extend mapping name
Note: See TracChangeset for help on using the changeset viewer.