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

    r388 r432  
    1717#define NB_ITERATION    1000000000
    1818
    19 #define PRINTF(...)      ({ if (giet_procid() == 0) { giet_tty_printf(__VA_ARGS__); } })
     19#define PRINTF(...) ({ if ( proc_id==0) { giet_tty_printf(__VA_ARGS__); } })
    2020
    2121giet_barrier_t barriers[2];
     
    127127__attribute__((constructor)) void main()
    128128{
    129    unsigned int proc_id       = giet_procid();              // processor id
     129   // get processor identifier
     130   unsigned int x;
     131   unsigned int y;
     132   unsigned int p;
     133   giet_proc_xyp( &x, &y, &p );
     134
     135   // compute continuous processor index
     136   unsigned int proc_id = (((x * Y_SIZE) + y) * NB_PROCS_MAX) + p; 
     137
    130138   unsigned int nlocal_procs  = NB_PROCS_MAX;               // processors per cluster
    131139   unsigned int nclusters     = X_SIZE*Y_SIZE;              // number of clusters
    132    unsigned int nglobal_procs = nclusters * nlocal_procs;   // number of tasks
     140   unsigned int nglobal_procs = nclusters * nlocal_procs;   // number of processors
    133141   size_t i;
    134142
     
    158166   for (i = 0; i < NB_ITERATION; i++)
    159167   {
    160       //PRINTF("\n*** Starting computation for iteration %d at cycle %d\n", i, giet_proctime());
    161168      compute_new_gen(base_line, nb_line);
    162       //PRINTF("\n*** Starting display for iteration %d at cycle %d\n", i, giet_proctime());
    163169      grow_old_world(base_line, nb_line);
    164170      display_world(base_line, nb_line);
Note: See TracChangeset for help on using the changeset viewer.