Ignore:
Timestamp:
Oct 1, 2015, 4:09:25 PM (9 years ago)
Author:
alain
Message:

Adapt the following application to the POSIX threads API

  • convol
  • classif
  • raycast
  • coproc
  • display
  • gameoflife
  • transpose
  • shell
File:
1 edited

Legend:

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

    r669 r708  
    1111#  application on a multi-clusters, multi-processors architecture.
    1212#  This include both the mapping of virtual segments on the clusters,
    13 #  and the mapping of tasks on processors.
    14 #  There is one task per processor.
     13#  and the mapping of threads on processors.
     14#  There is one thread per processor.
    1515#  The mapping of virtual segments is the following:
    1616#    - There is one shared data vseg in cluster[0][0]
     
    8585                                     local = True, big = True )
    8686           
    87     # heap vsegs : distributed but non local (any heap can be accessed by any task)
     87    # heap vsegs : distributed but non local (any heap can be accessed by any thread)
    8888    for x in xrange (x_size):
    8989        for y in xrange (y_size):
     
    9797                                 local = False, big = True )
    9898
    99     # distributed tasks : one task per processor
     99    # distributed threads : one thread per processor
    100100    for x in xrange (x_size):
    101101        for y in xrange (y_size):
     
    103103            if ( mapping.clusters[cluster_id].procs ):
    104104                for p in xrange( nprocs ):
    105                     trdid = (((x * y_size) + y) * nprocs) + p
     105                    if (x == 0) and (y == 0) and (p == 0) :   # main thread
     106                        startid = 1
     107                        is_main = True
     108                    else :                                    # trsp thread
     109                        startid = 0
     110                        is_main = False
    106111
    107                     mapping.addTask( vspace, 'conv_%d_%d_%d' % (x,y,p),
    108                                      trdid, x, y, p,
    109                                      'conv_stack_%d_%d_%d' % (x,y,p),
    110                                      'conv_heap_%d_%d' % (x,y), 0 )
     112                    mapping.addThread( vspace,
     113                                       'conv_%d_%d_%d' % (x,y,p),
     114                                       is_main,
     115                                       x, y, p,
     116                                       'conv_stack_%d_%d_%d' % (x,y,p),
     117                                       'conv_heap_%d_%d' % (x,y),
     118                                       startid )
    111119
    112120    # extend mapping name
Note: See TracChangeset for help on using the changeset viewer.