Ignore:
Timestamp:
Oct 4, 2014, 4:33:31 PM (10 years ago)
Author:
alain
Message:

1) Introduce the "applications" directory.
2) Introduce the fixed format (X_WIDTH / Y_WIDTH / P_WIDTH) for processor index in all applications.

Location:
soft/giet_vm/applications
Files:
1 added
1 edited
1 moved

Legend:

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

    r398 r432  
    6666    unsigned int c;                                                // cluster index for loops
    6767
    68     unsigned int proc_id    = giet_procid();                       // global processor id
    69     unsigned int lpid       = proc_id % NB_PROCS_MAX;              // local processor id
    70     unsigned int cluster_xy = proc_id / NB_PROCS_MAX;              // 8 bits format
    71     unsigned int x          = cluster_xy >> Y_WIDTH;               // x coordinate
    72     unsigned int y          = cluster_xy & ((1<<Y_WIDTH)-1);       // y coordinate
     68    // get processor identifiers
     69    unsigned int x;                                                // x cluster coordinate
     70    unsigned int y;                                                // y cluster coordinate
     71    unsigned int lpid;                                             // local processor index
     72    giet_proc_xyp( &x, &y, &lpid);             
    7373
    7474    unsigned int npixels    = NN * NN;                             // pixels per image
     
    8383    // It includes parameters checking, barriers initialization,
    8484    // distributed buffers allocation, and file open
    85     if ( proc_id == 0 )
     85    if ( (x==0) && (y==0) && (lpid==0) )
    8686    {
    8787        // Parameters checking
     
    140140        if (file < 0)
    141141        {
    142             giet_shr_printf("\n[TRANSPOSE ERROR] Processor[%d,%d,%d]"
     142            giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d]"
    143143                            " cannot open file misc/images.raw",
    144144                            x, y, lpid );
     
    147147        else
    148148        {
    149             giet_shr_printf("\n[TRANSPOSE] Processor[0,0,0] open file misc/images.raw\n");
     149            giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file misc/images.raw\n");
    150150        }
    151151        init_ok = 0;
     
    154154    {
    155155        while ( init_ok == 1 );
     156        giet_shr_printf("\n[TRANSPOSE] Processor[%d,%d,%d] starts at cycle %d\n", x, y, lpid);
    156157    }
    157158   
    158 
    159159    /////////////////////////
    160160    // Main loop (on images)
     
    173173                           ((image*nblocks) + ((nblocks*cluster_id)/NB_CLUSTERS)) );
    174174
    175             giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,0] completes load"
     175            giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes load"
    176176                            "  for image %d at cycle %d\n",
    177                             x, y, image, giet_proctime() );
     177                            x, y, lpid, image, giet_proctime() );
    178178        }
    179179
     
    307307        barrier_wait( &barrier );
    308308
    309         // instrumentation done by processor [0,0,0]
    310 
    311         if ( (proc_id == 0) && INSTRUMENTATION_OK )
     309        // instrumentation done by processor [0,0,0]
     310        if ( (x==0) && (y==0) && (lpid==0) && INSTRUMENTATION_OK )
    312311        {
    313312            int cc, pp;
     
    377376
    378377    // Processor[0,0,0] releases the Distributed buffers
    379     if ( proc_id == 0 )
     378    if ( (x==0) && (y==0) && (lpid==0) )
    380379    {
    381380        for ( c = 0 ; c < NB_CLUSTERS ; c++ )
Note: See TracChangeset for help on using the changeset viewer.