Changeset 549 for soft


Ignore:
Timestamp:
Apr 5, 2015, 12:16:18 AM (10 years ago)
Author:
alain
Message:

1) Use private TTY terminals for all tasks in cluster[0,0].
2) Increase the average value of the random delay in the analyse task.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/classif/main.c

    r542 r549  
    3434//
    3535// Initialisation is done in three steps by the "load" & "store" tasks:
    36 // - Task "load" in cluster[0][0] initialises the heaps in all clusters. Other tasks
    37 //   are waiting on the global_sync synchronisation variable.
    38 // - Then task "load" in cluster[0][0] initialises the barrier between all "load"
    39 //   tasks, allocates NIC & CMA RX channel, and starts the NIC_CMA RX transfer.
    40 //   Other "load" tasks are waiting on the load_sync synchronisation variable.
    41 //   Task "store" in cluster[0][0] initialises the barrier between all "store" tasks,
    42 //   allocates NIC & CMA TX channels, and starts the NIC_CMA TX transfer.
    43 //   Other "store" tasks are waiting on the store_sync synchronisation variable.
    44 // - When this global initialisation is completed, the "load" task in all clusters
    45 //   allocates the working containers and the MWMR fifos descriptors from the
    46 //   user local heap. In each cluster, the "analyse" and "store" tasks are waiting
    47 //   the local initialisation completion on the local_sync[x][y] variables.
     36// 1) Task "load" in cluster[0][0] initialises the heaps in all clusters. Other tasks
     37//    are waiting on the global_sync synchronisation variable.
     38// 2) Then task "load" in cluster[0][0] initialises the barrier between all "load"
     39//    tasks, allocates NIC & CMA RX channel, and starts the NIC_CMA RX transfer.
     40//    Other "load" tasks are waiting on the load_sync synchronisation variable.
     41//    Task "store" in cluster[0][0] initialises the barrier between all "store" tasks,
     42//    allocates NIC & CMA TX channels, and starts the NIC_CMA TX transfer.
     43//    Other "store" tasks are waiting on the store_sync synchronisation variable.
     44// 3) When this global initialisation is completed, the "load" task in all clusters
     45//    allocates the working containers and the MWMR fifos descriptors from the
     46//    user local heap. In each cluster, the "analyse" and "store" tasks are waiting
     47//    the local initialisation completion on the local_sync[x][y] variables.
    4848//
    4949// When initialisation is completed, all tasks loop on containers:
     
    8282// The MWMR channels (descriptors and buffers), as well as the working containers
    8383// used by the "analysis" tasks are distributed in clusters.
    84 // But the pointers on these distributed structures are shared arrays
    85 // stored in cluster[0][0].
     84// But the pointers on these distributed structures are stored in cluster[0][0].
    8685///////////////////////////////////////////////////////////////////////////////////////
    8786
     
    143142    if ( (x==0) && (y==0) )
    144143    {
    145         giet_shr_printf("\n*** Task load on P[%d][%d][%d] starts at cycle %d\n"
     144        giet_tty_alloc();
     145
     146        giet_tty_printf("\n*** Task load on P[%d][%d][%d] starts at cycle %d\n"
    146147                        "  x_size = %d / y_size = %d / nprocs = %d\n",
    147148                        x , y , l , giet_proctime() , x_size, y_size, nprocs );
    148149
    149     unsigned int xid;  // x cluster coordinate index
    150     unsigned int yid;  // y cluster coordinate index
    151 
    152     for ( xid = 0 ; xid < x_size ; xid++ )
    153       {
    154         for ( yid = 0 ; yid < y_size ; yid++ )
    155           {
    156             heap_init( xid, yid );
    157           }
    158       }
     150        unsigned int xid;  // x cluster coordinate index
     151        unsigned int yid;  // y cluster coordinate index
     152
     153        for ( xid = 0 ; xid < x_size ; xid++ )
     154        {
     155                for ( yid = 0 ; yid < y_size ; yid++ )
     156                {
     157                    heap_init( xid, yid );
     158                }
     159        }
    159160   
    160         global_sync = 1;
     161            global_sync = 1;
    161162
    162163        sqt_barrier_init( &rx_barrier, x_size , y_size , 1 );
     
    213214    // load task[0][0] displays status
    214215    if ( (x==0) && (y==0) )
    215     giet_shr_printf("\n*** Task load on P[%d,%d,%d] enters main loop at cycle %d\n"
     216    giet_tty_printf("\n*** Task load on P[%d,%d,%d] enters main loop at cycle %d\n"
    216217                    "      nic_rx_channel = %d / nic_tx_channel = %d\n"
    217218                    "      &mwmr_l2a  = %x / &data_l2a  = %x\n"
     
    248249
    249250        if ( (x==0) && (y==0) )
    250         giet_shr_printf("\n*** Task load on P[%d,%d,%d] get container %d at cycle %d"
     251        giet_tty_printf("\n*** Task load on P[%d,%d,%d] get container %d at cycle %d"
    251252                        " : %d packets / %d words\n",
    252253                        x, y, l, count, giet_proctime(), npackets, nwords );
     
    298299    if ( (x==0) && (y==0) )
    299300    {
    300         giet_shr_printf("\n*** Task store on P[%d][%d][%d] starts at cycle %d\n"
     301        giet_tty_alloc();
     302
     303        giet_tty_printf("\n*** Task store on P[%d][%d][%d] starts at cycle %d\n"
    301304                        "  x_size = %d / y_size = %d / nprocs = %d\n",
    302305                        x , y , l , giet_proctime() , x_size, y_size, nprocs );
     
    332335    // "store" task[0][0] displays status
    333336    if ( (x==0) && (y==0) )
    334     giet_shr_printf("\n*** Task store on P[%d,%d,%d] enters main loop at cycle %d\n"
     337    giet_tty_printf("\n*** Task store on P[%d,%d,%d] enters main loop at cycle %d\n"
    335338                    "      &mwmr_l2a  = %x\n"
    336339                    "      &mwmr_a2s  = %x\n"
     
    364367
    365368        if ( (x==0) && (y==0) )
    366         giet_shr_printf("\n*** Task store on P[%d,%d,%d] get container %d at cycle %d"
     369        giet_tty_printf("\n*** Task store on P[%d,%d,%d] get container %d at cycle %d"
    367370                        " : %d packets / %d words\n",
    368371                        x, y, l, count, giet_proctime(), npackets, nwords );
     
    382385        giet_nic_tx_stop( nic_tx_channel );
    383386
    384         giet_shr_printf("\n@@@@ Classification Results @@@\n"
     387        giet_tty_printf("\n@@@@ Classification Results @@@\n"
    385388                        " - TYPE 0 : %d packets\n"
    386389                        " - TYPE 1 : %d packets\n"
     
    436439    if ( (x==0) && (y==0) )
    437440    {
    438         giet_shr_printf("\n*** Task analyse on P[%d][%d][%d] starts at cycle %d\n"
     441        giet_tty_alloc();
     442
     443        giet_tty_printf("\n*** Task analyse on P[%d][%d][%d] starts at cycle %d\n"
    439444                        "  x_size = %d / y_size = %d / nprocs = %d\n",
    440445                        x , y , l , giet_proctime() , x_size, y_size, nprocs );
     
    459464    // "analyse" task[0][0] display status
    460465    if ( (x==0) && (y==0) )
    461     giet_shr_printf("\n*** Task analyse on P[%d,%d,%d] enters main loop at cycle %d\n"
     466    giet_tty_printf("\n*** Task analyse on P[%d,%d,%d] enters main loop at cycle %d\n"
    462467                    "       &mwmr_l2a = %x\n"
    463468                    "       &mwmr_a2s = %x\n"
     
    505510
    506511        if ( (x==0) && (y==0) )
    507         giet_shr_printf("\n*** Task analyse on P[%d,%d,%d] get container at cycle %d"
     512        giet_tty_printf("\n*** Task analyse on P[%d,%d,%d] get container at cycle %d"
    508513                        " : %d packets / %d words\n",
    509514                                                x, y, l, giet_proctime(), npackets, nwords );
     
    552557#if VERBOSE_ANALYSE
    553558        if ( (x==0) && (y==0) )
    554         giet_shr_printf("\n*** Task analyse on P[%d,%d,%d] completes at cycle %d\n"
     559        giet_tty_printf("\n*** Task analyse on P[%d,%d,%d] completes at cycle %d\n"
    555560                        "   - Packet 0 : plen = %d / dst_mac = %l / src_mac = %l\n"
    556561                        "   - Packet 1 : plen = %d / dst_mac = %l / src_mac = %l\n"
     
    577582           
    578583        // pseudo-random delay
    579         for( p = 0 ; p < (giet_rand()>>4) ; p++ ) asm volatile ("nop");
     584        unsigned int delay = giet_rand()>>3;
     585        for( p = 0 ; p < delay ; p++ ) asm volatile ("nop");
    580586
    581587        // put the working container index to fifo_a2s
Note: See TracChangeset for help on using the changeset viewer.