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/convol/main.c

    r402 r432  
    9494    int z; // vertical filter index for loops
    9595
     96    // processor identifiers
     97    unsigned int x;                                           // x coordinate
     98    unsigned int y;                                           // y coordinate
     99    unsigned int lpid;                                        // local proc/task id
     100    giet_proc_xyp( &x, &y, &lpid );
     101
    96102    int          file        = 0;                             // file descriptor
    97     unsigned int pid         = giet_procid();                 // processor id
    98103    unsigned int nprocs      = NB_PROCS_MAX;                  // procs per cluster
    99104    unsigned int nclusters   = NB_CLUSTERS;                   // number of clusters
    100     unsigned int lpid        = pid % nprocs;                  // local task id
    101     unsigned int cluster_xy  = pid / nprocs;                  // cluster index
    102     unsigned int x           = cluster_xy >> Y_WIDTH;         // x coordinate
    103     unsigned int y           = cluster_xy & ((1<<Y_WIDTH)-1); // y coordinate
    104105    unsigned int cluster_id  = (x * Y_SIZE) + y;              // continuous cluster index
    105106    unsigned int task_id     = (cluster_id * nprocs) + lpid;  // continuous task index
     
    145146    ///////////////////////////////////////////////////////////////////
    146147   
    147     if ( pid == 0 )
     148    if ( (x==0) && (y==0) && (lpid==0) )
    148149    {
    149150        giet_shr_printf("\n[CONVOL] task[0,0,0] starts barrier init at cycle %d\n"
     
    237238    // Other tasks are waiting on the init_ok condition.
    238239    //////////////////////////////////////////////////////////////////////////
    239     if ( pid == 0 )
     240    if ( (x==0) && (y==0) && (lpid==0) )
    240241    {
    241242        // open file
     
    331332                 x, y, lpid, date );
    332333#else
    333 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter"
    334                                  " at cycle %d\n", date );
     334if ( (x==0) && (y==0) && (lpid==0) )
     335giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter"
     336                 " at cycle %d\n", date );
    335337#endif
    336338
     
    404406                 x, y, lpid, date );
    405407#else
    406 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter"
    407                                  " at cycle %d\n", date );
     408if ( (x==0) && (y==0) && (lpid==0) )
     409giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter"
     410                 " at cycle %d\n", date );
    408411#endif
    409412
     
    433436                 x, y, lpid, date );
    434437#else
    435 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter"
    436                                  " at cycle %d\n", date );
     438if ( (x==0) && (y==0) && (lpid==0) )
     439giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter"
     440                 " at cycle %d\n", date );
    437441#endif
    438442
     
    522526                 x, y, lpid, date );
    523527#else
    524 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter"
    525                                  " at cycle %d\n", date );
     528if ( (x==0) && (y==0) && (lpid==0) )
     529giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter"
     530                 " at cycle %d\n", date );
    526531#endif
    527532
     
    548553                 x, y, lpid, date);
    549554#else
    550 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display"
    551                                  " at cycle %d\n", date );
     555if ( (x==0) && (y==0) && (lpid==0) )
     556giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display"
     557                 " at cycle %d\n", date );
    552558#endif
    553559
     
    579585                 x, y, lpid, date);
    580586#else
    581 if ( pid == 0 ) giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display"
    582                                  " at cycle %d\n", date );
     587if ( (x==0) && (y==0) && (lpid==0) )
     588giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display"
     589                 " at cycle %d\n", date );
    583590#endif
    584591     
     
    596603    /////////////////////////////////////////////////////////
    597604
    598     if ( pid == 0 )
     605    if ( (x==0) && (y==0) && (lpid==0) )
    599606    {
    600607        date  = giet_proctime();
Note: See TracChangeset for help on using the changeset viewer.