Changeset 669


Ignore:
Timestamp:
Jul 27, 2015, 8:40:45 PM (9 years ago)
Author:
alain
Message:

Introduce support for the "shared" argument in the giet_tty_alloc() system call,
and replace the giet_shr_printf() system call by giet_tty_printf().

Location:
soft/giet_vm/applications
Files:
12 edited

Legend:

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

    r549 r669  
    1111// It can run on architectures containing up to 16 * 16 clusters,
    1212// and up to 8 processors per cluster.
     13//
     14// It requires N+2 TTY terminals, as each task in cluster[0][0] displays messages.
    1315//
    1416// This application is described as a TCG (Task and Communication Graph)
     
    142144    if ( (x==0) && (y==0) )
    143145    {
    144         giet_tty_alloc();
     146        // allocate a private TTY
     147        giet_tty_alloc(0);
    145148
    146149        giet_tty_printf("\n*** Task load on P[%d][%d][%d] starts at cycle %d\n"
     
    299302    if ( (x==0) && (y==0) )
    300303    {
    301         giet_tty_alloc();
     304        // allocate a private TTY
     305        giet_tty_alloc(0);
    302306
    303307        giet_tty_printf("\n*** Task store on P[%d][%d][%d] starts at cycle %d\n"
     
    439443    if ( (x==0) && (y==0) )
    440444    {
    441         giet_tty_alloc();
     445        // allocate a private TTY
     446        giet_tty_alloc(0);
    442447
    443448        giet_tty_printf("\n*** Task analyse on P[%d][%d][%d] starts at cycle %d\n"
  • soft/giet_vm/applications/convol/convol.py

    r610 r669  
    4040   
    4141    data_base  = 0x20000000
    42     data_size  = 0x00010000     # 64 Kbytes (non replicated)
     42    data_size  = 0x00020000     # 128 Kbytes (non replicated)
    4343
    4444    heap_base  = 0x40000000     
     
    4949
    5050    # create Vspace
    51     vspace = mapping.addVspace( name = 'convol', startname = 'conv_data' )
     51    vspace = mapping.addVspace( name = 'convol', startname = 'conv_data', active = False )
    5252   
    5353    # data vseg in cluster[0,0] : non local
  • soft/giet_vm/applications/convol/main.c

    r589 r669  
    11///////////////////////////////////////////////////////////////////////////////////////
    2 // File   : main.c   (for convol application)
     2// File   : main.c   (convol application)
    33// Date   : june 2014
    44// author : Alain Greiner
     
    2222
    2323#define USE_SQT_BARRIER            1
    24 #define VERBOSE                    0
     24#define VERBOSE                    1
    2525#define SUPER_VERBOSE              0
    2626
     
    4949#define max(x,y) ((x) > (y) ? (x) : (y))
    5050#define min(x,y) ((x) < (y) ? (x) : (y))
     51
     52// macro to use a shared TTY
     53#define printf(...)     lock_acquire( &tty_lock ); \
     54                        giet_tty_printf(__VA_ARGS__);  \
     55                        lock_release( &tty_lock )
    5156
    5257// global instrumentation counters (cluster_id, lpid]
     
    6065unsigned int D_END[CLUSTERS_MAX][PROCS_MAX];
    6166
    62 // global synchronization barrier
     67// global synchronization barriers
    6368
    6469#if USE_SQT_BARRIER
     
    7176volatile unsigned int load_image_ok      = 0;
    7277volatile unsigned int instrumentation_ok = 0;
     78
     79// lock protecting access to shared TTY
     80user_lock_t         tty_lock;
    7381
    7482// global pointers on distributed buffers in all clusters
     
    138146    START[cluster_id][lpid] = date;
    139147
    140 #if VERBOSE
    141 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] starts at cycle %d\n", x,y,lpid, date );
    142 #endif
    143 
    144148     // parameters checking
    145149   
     
    161165   
    162166    ///////////////////////////////////////////////////////////////////
    163     // task[0][0][0] makes barrier initialisation
     167    // task[0][0][0] makes various initialisations
    164168    ///////////////////////////////////////////////////////////////////
    165169   
    166170    if ( (x==0) && (y==0) && (lpid==0) )
    167171    {
    168         giet_shr_printf("\n[CONVOL] task[0,0,0] starts barrier init at cycle %d\n"
    169                         "- CLUSTERS   = %d\n"
    170                         "- PROCS      = %d\n"
    171                         "- TASKS      = %d\n"
    172                         "- LINES/TASK = %d\n",
    173                         giet_proctime(), nclusters, nprocs, ntasks, lines_per_task );
     172        // get a shared TTY
     173        giet_tty_alloc( 1 );
     174
     175        // initializes TTY lock
     176        lock_init( &tty_lock );
     177
     178        // initializes the distributed heap[x,y]
     179        unsigned int cx;
     180        unsigned int cy;
     181        for ( cx = 0 ; cx < x_size ; cx++ )
     182        {
     183            for ( cy = 0 ; cy < y_size ; cy++ )
     184            {
     185                heap_init( cx , cy );
     186            }
     187        }
     188
    174189#if USE_SQT_BARRIER
    175190        sqt_barrier_init( &barrier, x_size , y_size , nprocs );
     
    178193#endif
    179194
    180         giet_shr_printf( "\n[CONVOL] task[0,0,0] completes barrier init at cycle %d\n",
    181                          giet_proctime() );
     195        printf("\n[CONVOL] task[0,0,0] completes initialisation at cycle %d\n"
     196               "- CLUSTERS   = %d\n"
     197               "- PROCS      = %d\n"
     198               "- TASKS      = %d\n"
     199               "- LINES/TASK = %d\n",
     200               giet_proctime(), nclusters, nprocs, ntasks, lines_per_task );
    182201
    183202        barrier_init_ok = 1;
     
    196215
    197216#if VERBOSE
    198 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] enters malloc at cycle %d\n",
     217printf( "\n[CONVOL] task[%d,%d,%d] enters malloc at cycle %d\n",
    199218                 x,y,lpid, date );
    200219#endif
     
    207226       
    208227#if VERBOSE
    209 giet_shr_printf( "\n[CONVOL]  Shared Buffer Virtual Addresses in cluster(%d,%d)\n"
    210                  "### GA = %x\n"
    211                  "### GB = %x\n"               
    212                  "### GC = %x\n"               
    213                  "### GD = %x\n"               
    214                  "### GZ = %x\n",
    215                  x, y,
    216                  GA[cluster_id],
    217                  GB[cluster_id],
    218                  GC[cluster_id],
    219                  GD[cluster_id],
    220                  GZ[cluster_id] );
     228printf( "\n[CONVOL]  Shared Buffer Virtual Addresses in cluster(%d,%d)\n"
     229        "### GA = %x\n"
     230        "### GB = %x\n"               
     231        "### GC = %x\n"               
     232        "### GD = %x\n"               
     233        "### GZ = %x\n",
     234        x, y,
     235        GA[cluster_id],
     236        GB[cluster_id],
     237        GC[cluster_id],
     238        GD[cluster_id],
     239        GZ[cluster_id] );
    221240#endif
    222241    }
     
    257276    {
    258277        // open file
    259         file = giet_fat_open( "misc/philips_image.raw" , 0 );
     278        file = giet_fat_open( "/misc/philips_1024.raw" , 0 );
    260279        if ( file < 0 ) giet_exit( "[CONVOL ERROR] task[0,0,0] cannot open"
    261                                    " file misc/philips_image.raw" );
     280                                   " file /misc/philips_1024.raw" );
    262281 
    263         giet_shr_printf( "\n[CONVOL] task[0,0,0] open file misc/philips_image.raw"
    264                          " at cycle %d\n", giet_proctime() );
     282        printf( "\n[CONVOL] task[0,0,0] open file /misc/philips_1024.raw"
     283                " at cycle %d\n", giet_proctime() );
    265284
    266285        for ( c = 0 ; c < nclusters ; c++ )
    267286        {
    268             giet_shr_printf( "\n[CONVOL] task[0,0,0] starts load "
    269                              "for cluster %d at cycle %d\n", c, giet_proctime() );
     287            printf( "\n[CONVOL] task[0,0,0] starts load "
     288                    "for cluster %d at cycle %d\n", c, giet_proctime() );
    270289
    271290            giet_fat_lseek( file,
     
    277296                           frame_size/nclusters );
    278297
    279             giet_shr_printf( "\n[CONVOL] task[0,0,0] completes load "
    280                              "for cluster %d at cycle %d\n", c, giet_proctime() );
     298            printf( "\n[CONVOL] task[0,0,0] completes load "
     299                    "for cluster %d at cycle %d\n", c, giet_proctime() );
    281300        }
    282301        load_image_ok = 1;
     
    296315
    297316#if VERBOSE
    298 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] starts initial display"
    299                  " at cycle %d\n",
    300                  x, y, lpid, giet_proctime() );
     317printf( "\n[CONVOL] task[%d,%d,%d] starts initial display"
     318        " at cycle %d\n",
     319        x, y, lpid, giet_proctime() );
    301320#endif
    302321
     
    319338
    320339#if VERBOSE
    321 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] completes initial display"
    322                  " at cycle %d\n",
    323                  x, y, lpid, giet_proctime() );
     340printf( "\n[CONVOL] task[%d,%d,%d] completes initial display"
     341        " at cycle %d\n",
     342        x, y, lpid, giet_proctime() );
    324343#endif
    325344
     
    347366
    348367#if VERBOSE
    349 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] starts horizontal filter"
    350                  " at cycle %d\n",
    351                  x, y, lpid, date );
     368printf( "\n[CONVOL] task[%d,%d,%d] starts horizontal filter"
     369        " at cycle %d\n",
     370        x, y, lpid, date );
    352371#else
    353372if ( (x==0) && (y==0) && (lpid==0) )
    354 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts horizontal filter"
    355                  " at cycle %d\n", date );
     373printf( "\n[CONVOL] task[0,0,0] starts horizontal filter"
     374        " at cycle %d\n", date );
    356375#endif
    357376
     
    412431
    413432#if SUPER_VERBOSE
    414 giet_shr_printf(" - line %d computed at cycle %d\n", l, giet_proctime() );
     433printf(" - line %d computed at cycle %d\n", l, giet_proctime() );
    415434#endif   
    416435
     
    421440
    422441#if VERBOSE
    423 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] completes horizontal filter"
    424                  " at cycle %d\n",
    425                  x, y, lpid, date );
     442printf( "\n[CONVOL] task[%d,%d,%d] completes horizontal filter"
     443        " at cycle %d\n",
     444        x, y, lpid, date );
    426445#else
    427446if ( (x==0) && (y==0) && (lpid==0) )
    428 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes horizontal filter"
    429                  " at cycle %d\n", date );
     447printf( "\n[CONVOL] task[0,0,0] completes horizontal filter"
     448        " at cycle %d\n", date );
    430449#endif
    431450
     
    451470
    452471#if VERBOSE
    453 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] starts vertical filter"
    454                  " at cycle %d\n",
    455                  x, y, lpid, date );
     472printf( "\n[CONVOL] task[%d,%d,%d] starts vertical filter"
     473        " at cycle %d\n",
     474        x, y, lpid, date );
    456475#else
    457476if ( (x==0) && (y==0) && (lpid==0) )
    458 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts vertical filter"
    459                  " at cycle %d\n", date );
     477printf( "\n[CONVOL] task[0,0,0] starts vertical filter"
     478        " at cycle %d\n", date );
    460479#endif
    461480
     
    532551
    533552#if SUPER_VERBOSE
    534 giet_shr_printf(" - column %d computed at cycle %d\n", p, giet_proctime());
     553printf(" - column %d computed at cycle %d\n", p, giet_proctime());
    535554#endif
    536555
     
    541560
    542561#if VERBOSE
    543 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] completes vertical filter"
    544                  " at cycle %d\n",
    545                  x, y, lpid, date );
     562printf( "\n[CONVOL] task[%d,%d,%d] completes vertical filter"
     563        " at cycle %d\n",
     564        x, y, lpid, date );
    546565#else
    547566if ( (x==0) && (y==0) && (lpid==0) )
    548 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes vertical filter"
    549                  " at cycle %d\n", date );
     567printf( "\n[CONVOL] task[0,0,0] completes vertical filter"
     568        " at cycle %d\n", date );
    550569#endif
    551570
     
    568587
    569588#if VERBOSE
    570 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] starts final display"
    571                  " at cycle %d\n",
    572                  x, y, lpid, date);
     589printf( "\n[CONVOL] task[%d,%d,%d] starts final display"
     590        " at cycle %d\n",
     591        x, y, lpid, date);
    573592#else
    574593if ( (x==0) && (y==0) && (lpid==0) )
    575 giet_shr_printf( "\n[CONVOL] task[0,0,0] starts final display"
    576                  " at cycle %d\n", date );
     594printf( "\n[CONVOL] task[0,0,0] starts final display"
     595        " at cycle %d\n", date );
    577596#endif
    578597
     
    600619
    601620#if VERBOSE
    602 giet_shr_printf( "\n[CONVOL] task[%d,%d,%d] completes final display"
    603                  " at cycle %d\n",
    604                  x, y, lpid, date);
     621printf( "\n[CONVOL] task[%d,%d,%d] completes final display"
     622        " at cycle %d\n",
     623        x, y, lpid, date);
    605624#else
    606625if ( (x==0) && (y==0) && (lpid==0) )
    607 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes final display"
    608                  " at cycle %d\n", date );
     626printf( "\n[CONVOL] task[0,0,0] completes final display"
     627        " at cycle %d\n", date );
    609628#endif
    610629     
     
    625644    {
    626645        date  = giet_proctime();
    627         giet_shr_printf("\n[CONVOL] task[0,0,0] starts instrumentation"
    628                         " at cycle %d\n\n", date );
     646        printf("\n[CONVOL] task[0,0,0] starts instrumentation"
     647               " at cycle %d\n\n", date );
    629648
    630649        int cc, pp;
     
    678697        }
    679698
    680         giet_shr_printf(" - START : min = %d / max = %d / med = %d / delta = %d\n",
     699        printf(" - START : min = %d / max = %d / med = %d / delta = %d\n",
    681700               min_start, max_start, (min_start+max_start)/2, max_start-min_start);
    682701
    683         giet_shr_printf(" - H_BEG : min = %d / max = %d / med = %d / delta = %d\n",
     702        printf(" - H_BEG : min = %d / max = %d / med = %d / delta = %d\n",
    684703               min_h_beg, max_h_beg, (min_h_beg+max_h_beg)/2, max_h_beg-min_h_beg);
    685704
    686         giet_shr_printf(" - H_END : min = %d / max = %d / med = %d / delta = %d\n",
     705        printf(" - H_END : min = %d / max = %d / med = %d / delta = %d\n",
    687706               min_h_end, max_h_end, (min_h_end+max_h_end)/2, max_h_end-min_h_end);
    688707
    689         giet_shr_printf(" - V_BEG : min = %d / max = %d / med = %d / delta = %d\n",
     708        printf(" - V_BEG : min = %d / max = %d / med = %d / delta = %d\n",
    690709               min_v_beg, max_v_beg, (min_v_beg+max_v_beg)/2, max_v_beg-min_v_beg);
    691710
    692         giet_shr_printf(" - V_END : min = %d / max = %d / med = %d / delta = %d\n",
     711        printf(" - V_END : min = %d / max = %d / med = %d / delta = %d\n",
    693712               min_v_end, max_v_end, (min_v_end+max_v_end)/2, max_v_end-min_v_end);
    694713
    695         giet_shr_printf(" - D_BEG : min = %d / max = %d / med = %d / delta = %d\n",
     714        printf(" - D_BEG : min = %d / max = %d / med = %d / delta = %d\n",
    696715               min_d_beg, max_d_beg, (min_d_beg+max_d_beg)/2, max_d_beg-min_d_beg);
    697716
    698         giet_shr_printf(" - D_END : min = %d / max = %d / med = %d / delta = %d\n",
     717        printf(" - D_END : min = %d / max = %d / med = %d / delta = %d\n",
    699718               min_d_end, max_d_end, (min_d_end+max_d_end)/2, max_d_end-min_d_end);
    700719
    701         giet_shr_printf( "\n General Scenario (Kcycles for each step)\n" );
    702         giet_shr_printf( " - BOOT OS           = %d\n", (min_start            )/1000 );
    703         giet_shr_printf( " - LOAD IMAGE        = %d\n", (min_h_beg - min_start)/1000 );
    704         giet_shr_printf( " - H_FILTER          = %d\n", (max_h_end - min_h_beg)/1000 );
    705         giet_shr_printf( " - BARRIER HORI/VERT = %d\n", (min_v_beg - max_h_end)/1000 );
    706         giet_shr_printf( " - V_FILTER          = %d\n", (max_v_end - min_v_beg)/1000 );
    707         giet_shr_printf( " - BARRIER VERT/DISP = %d\n", (min_d_beg - max_v_end)/1000 );
    708         giet_shr_printf( " - DISPLAY           = %d\n", (max_d_end - min_d_beg)/1000 );
     720        printf( "\n General Scenario (Kcycles for each step)\n" );
     721        printf( " - BOOT OS           = %d\n", (min_start            )/1000 );
     722        printf( " - LOAD IMAGE        = %d\n", (min_h_beg - min_start)/1000 );
     723        printf( " - H_FILTER          = %d\n", (max_h_end - min_h_beg)/1000 );
     724        printf( " - BARRIER HORI/VERT = %d\n", (min_v_beg - max_h_end)/1000 );
     725        printf( " - V_FILTER          = %d\n", (max_v_end - min_v_beg)/1000 );
     726        printf( " - BARRIER VERT/DISP = %d\n", (min_d_beg - max_v_end)/1000 );
     727        printf( " - DISPLAY           = %d\n", (max_d_end - min_d_beg)/1000 );
    709728
    710729        instrumentation_ok = 1;
  • soft/giet_vm/applications/coproc/main.c

    r589 r669  
    3434    giet_proc_xyp( &x, &y, &lpid );
    3535
    36     giet_shr_printf("\n*** Starting coproc application on processor"
     36    // get a private TTY terminal
     37    giet_tty_alloc( 0 );
     38
     39    giet_tty_printf("\n*** Starting coproc application on processor"
    3740                    "[%d,%d,%d] at cycle %d\n",
    3841                    x, y, lpid, giet_proctime() );
     
    6366
    6467if ( VERBOSE )
    65 giet_shr_printf("\n*** get GCD coprocessor at cycle %d\n", giet_proctime() );
     68giet_tty_printf("\n*** get GCD coprocessor at cycle %d\n", giet_proctime() );
    6669
    6770    //////////////////////// initializes channel for OPA
     
    8790   
    8891if ( VERBOSE )
    89 giet_shr_printf("\n*** channels initialized at cycle %d\n", giet_proctime() );
     92giet_tty_printf("\n*** channels initialized at cycle %d\n", giet_proctime() );
    9093
    9194    /////////////////////// starts communication channels
     
    9396
    9497if ( VERBOSE )
    95 giet_shr_printf("\n*** start GCD coprocessor at cycle %d\n", giet_proctime() );
     98giet_tty_printf("\n*** start GCD coprocessor at cycle %d\n", giet_proctime() );
    9699
    97100    /////////////////////// wait coprocessor completion
     
    102105
    103106if ( VERBOSE )
    104 giet_shr_printf("\n*** GCD computation completed at cycle %d\n", giet_proctime() );
     107giet_tty_printf("\n*** GCD computation completed at cycle %d\n", giet_proctime() );
    105108
    106109    // display result
    107110    for ( word = 0 ; word < VECTOR_SIZE ; word++ )
    108111    {
    109         giet_shr_printf("pgcd( %d , %d ) = %d\n",
     112        giet_tty_printf("pgcd( %d , %d ) = %d\n",
    110113        opa[word] , opb[word] , res[word] );
    111114    }
  • soft/giet_vm/applications/display/main.c

    r644 r669  
    1717#define NIMAGES     10                 
    1818
    19 #define INTERACTIVE 1
     19#define INTERACTIVE 0
    2020
    2121unsigned char buf0[NPIXELS*NLINES] __attribute__((aligned(64)));
     
    4747
    4848    // get a private TTY
    49     giet_tty_alloc();
     49    giet_tty_alloc(0);
    5050
    5151    giet_tty_printf("\n[DISPLAY] P[%d,%d,%d] starts at cycle %d\n"
  • soft/giet_vm/applications/gameoflife/gameoflife.py

    r610 r669  
    4949
    5050    # create vspace
    51     vspace = mapping.addVspace( name = 'gol', startname = 'gol_data' )
     51    vspace = mapping.addVspace( name = 'gameoflife', startname = 'gol_data', active = False )
    5252   
    5353    # data vseg : shared (only in cluster[0,0])
  • soft/giet_vm/applications/gameoflife/main.c

    r515 r669  
    55//            Alain Greiner <alain.greiner@lip6.fr> february 2015
    66//
    7 // This application is an emulation of the Game of Life automaton.
     7// This multi-threaded application is an emulation of the Game of Life automaton.
    88// The world size is defined by the HEIGHT and WIDTH parameters.
    99// There is one task per processor.
    1010// Each task compute HEIGHT/nbprocs lines.
    11 // Task running on processor P(0,0,0) initialises the barrier, and
    12 // the chained buffer DMA controler.
     11// Task running on processor P(0,0,0) initialises the barrier, the TTY terminal,
     12// and the chained buffer DMA controler.
    1313//
    1414// The number of processors must be a power of 2 not larger than HEIGHT.
     
    1919#include "user_barrier.h"
    2020#include "mapping_info.h"
     21#include "hard_config.h"
    2122
    2223#define WIDTH           128
     
    2425#define NB_ITERATION    1000000000
    2526
    26 #define PRINTF(...) ({ if ( proc_id==0) { giet_shr_printf(__VA_ARGS__); } })
     27#define PRINTF(...) ({ if ( proc_id==0) { giet_tty_printf(__VA_ARGS__); } })
    2728
    2829typedef unsigned char uint8_t;
     
    3132
    3233uint8_t DISPLAY[2][HEIGHT][WIDTH] __attribute__((aligned(64)));
     34
     35unsigned int status0[16];
     36unsigned int status1[16];
    3337
    3438giet_sqt_barrier_t barrier;
     
    121125////////////////////////////////////////
    122126__attribute__((constructor)) void main()
     127////////////////////////////////////////
    123128{
    124129   // get processor identifier
     
    131136   unsigned int x_size;
    132137   unsigned int y_size;
    133    unsigned int n_local_procs;
    134    giet_procs_number( &x_size, &y_size, &n_local_procs );
     138   unsigned int nprocs;
     139   giet_procs_number( &x_size, &y_size, &nprocs );
    135140
    136141   // compute continuous processor index & number of procs
    137    unsigned int proc_id = (((x * y_size) + y) * n_local_procs) + p; 
    138    unsigned int n_global_procs = x_size * y_size * n_local_procs;
     142   unsigned int proc_id = (((x * y_size) + y) * nprocs) + p; 
     143   unsigned int n_global_procs = x_size * y_size * nprocs;
    139144
    140145   unsigned int i;
    141 
    142    if ( n_global_procs > HEIGHT )
    143    {
    144        PRINTF("[GAMEOFLIFE ERROR] Number or processors too large :"
    145               " nb_procs = %d / image heigth = %d\n", n_global_procs, HEIGHT );
    146        giet_exit("error");
    147    }
    148146
    149147   unsigned int nb_line       = HEIGHT / n_global_procs;
    150148   unsigned int base_line     = nb_line * proc_id;
    151149   
    152    PRINTF("\n*** Starting barrier and CMA initialisation at cycle %d ***\n"
    153           " nprocs = %d / nlines = %d\n",
    154           giet_proctime() , n_global_procs, HEIGHT );
    155 
    156    //////////// barrier & CMA initialization ( P(0,0,0) )
    157 
     150   // parameters checking
     151   giet_assert( (n_global_procs <= HEIGHT),
     152                " Number or processors larger than world height" );
     153
     154   giet_assert( ((WIDTH == FBUF_X_SIZE) && (HEIGHT == FBUF_Y_SIZE)),
     155                "Frame Buffer size does not fit the world size" );
     156   
     157   giet_assert( ((x_size == 1) || (x_size == 2) || (x_size == 4) ||
     158                 (x_size == 8) || (x_size == 16)),
     159                "x_size must be a power of 2 no larger than 16" );
     160
     161   giet_assert( ((y_size == 1) || (y_size == 2) || (y_size == 4) ||
     162                 (y_size == 8) || (y_size == 16)),
     163                "y_size must be a power of 2 no larger than 16" );
     164
     165   giet_assert( ((nprocs == 1) || (nprocs == 2) || (nprocs == 4)),
     166                "nprocs must be a power of 2 no larger than 4" );
     167
     168   // P[0,0,0] makes initialisation
    158169   if ( proc_id == 0 )
    159170   {
    160       // initialises CMA component
     171      // get a private TTY for P[0,0,0]
     172      giet_tty_alloc( 0 );
     173
     174      // get a Chained Buffer DMA channel
    161175      giet_fbf_cma_alloc();
    162       giet_fbf_cma_start( &DISPLAY[0][0][0] ,
    163                           &DISPLAY[1][0][0] ,
    164                           HEIGHT * WIDTH );
     176
     177      // initializes the source and destination buffers
     178      giet_fbf_cma_init_buf( &DISPLAY[0][0][0] ,
     179                             &DISPLAY[1][0][0] ,
     180                             status0 ,
     181                             status1 );
     182
     183      // activates CMA channel
     184      giet_fbf_cma_start( HEIGHT * WIDTH );
     185
     186      // initializes distributed heap
     187      unsigned int cx;
     188      unsigned int cy;
     189      for ( cx = 0 ; cx < x_size ; cx++ )
     190      {
     191         for ( cx = 0 ; cx < x_size ; cx++ )
     192         {
     193            heap_init( cx , cy );
     194         }
     195      }
    165196
    166197      // initialises barrier
    167       sqt_barrier_init( &barrier , x_size , y_size , n_local_procs );
     198      sqt_barrier_init( &barrier , x_size , y_size , nprocs );
     199
     200      PRINTF("\n[GAMEOFLIFE] P[0,0,0] completes initialisation at cycle %d\n"
     201             " nprocs = %d / nlines = %d\n",
     202             giet_proctime() , n_global_procs, HEIGHT );
    168203
    169204      // activates all other processors
     
    175210   }
    176211
    177    PRINTF("\n*** Starting world initialisation at cycle %d ***\n",
    178           giet_proctime() );
    179 
    180212   ///////////// world  initialization ( All processors )
    181213
    182    // initialises WORLD[0]
     214   // All processors initialize WORLD[0]
    183215   init_world( 0 , base_line , nb_line );
    184216
     
    192224   if ( proc_id == 0 ) giet_fbf_cma_display ( 0 );
    193225
    194    PRINTF("\n*** Starting evolution at cycle %d ***\n", giet_proctime() );
     226   PRINTF("\n[GAMEOFLIFE] starts evolution at cycle %d\n", giet_proctime() );
    195227   
    196228   //////////// evolution : 2 steps per iteration
  • soft/giet_vm/applications/shell/main.c

    r660 r669  
    163163}
    164164
     165/////////////////////////////////////////
    165166static void cmd_rm(int argc, char **argv)
    166167{
     
    326327    int count = 0;
    327328
    328     giet_shr_printf("\n[SHELL] Enter at cycle %d\n", giet_proctime());
    329     giet_tty_alloc();
     329    // get a private TTY
     330    giet_tty_alloc( 0 );
     331
     332    // display first prompt
    330333    prompt();
    331334
  • soft/giet_vm/applications/sort/main.c

    r515 r669  
    33// Date   :  November 2013
    44// Author :  Cesar Fuguet Tortolero <cesar.fuguet-tortolero@lip6.fr>
     5///////////////////////////////////////////////////////////////////////////////
     6// This multi-threaded application implement a multi-stage sort application.
     7// The various stages are separated by synchronisation barriers.
     8// There is one thread per physical processors. Computation is organised as
     9// a binary tree: All threads contribute to the first stage of parallel sort
     10// but, the number of participating threads is divided by 2 at each next stage.
     11//       Number_of_stages = number of barriers = log2(Number_of_threads)
    512//
    6 // Description :
    7 //
    8 //      Sort application using the GIET-VM OS. This application uses the
    9 //      barrier routines to apply a sort algorithm in several stages.
    10 //
    11 //      Constraints :
    12 //
    13 //      - It supports up to 1024 processors and the number of processors
    14 //        must be a power of 2.
    15 //
    16 //      _ The array of values to be sorted (ARRAY_LENGTH) must be power of 2
    17 //        larger than the number of processors.
    18 //
    19 //      - This application must be executed on a cache coherent architecture.
    20 //
     13// Constraints :
     14// - It supports up to 1024 processors and the number of processors
     15//   must be a power of 2.
     16// _ The array of values to be sorted (ARRAY_LENGTH) must be power of 2
     17//   larger than the number of processors.
     18// - This application uses a private TTY terminal, shared by all threads,
     19//   that is protectted by an user-level SQT lock.
    2120///////////////////////////////////////////////////////////////////////////////
    2221
    2322#include "stdio.h"
    2423#include "mapping_info.h"
    25 #include "hard_config.h"
    2624#include "user_barrier.h"
     25#include "user_lock.h"
    2726
    2827#define ARRAY_LENGTH    0x1000
    2928#define IPT             (ARRAY_LENGTH / threads) // ITEMS PER THREAD
    3029
    31 ////////////////////////////////////////////////////////////////////////////////
    32 // Processors other than 0 display algorithm state if VERBOSE non zero
    33 
    34 #define VERBOSE         1
    35 
    36 ////////////////////////////////////////////////////////////////////////////////
    37 // Define printf according to verbosity option and number of available TTY
    38 
    39 #if (VERBOSE == 1)
    40 #   define printf(...)     giet_shr_printf(__VA_ARGS__)
    41 #else     
    42 #   define printf(...)
    43 #endif
    44 
    45 #define task0_printf(...) if(thread_id == 0) giet_shr_printf(__VA_ARGS__)
    46 
    47 int array0[ARRAY_LENGTH];
    48 int array1[ARRAY_LENGTH];
    49 
    50 volatile int init_ok = 0;
     30// macro to use a shared TTY
     31#define printf(...)     lock_acquire( &tty_lock ); \
     32                        giet_tty_printf(__VA_ARGS__);  \
     33                        lock_release( &tty_lock )
     34
     35int              array0[ARRAY_LENGTH];
     36int              array1[ARRAY_LENGTH];
     37
     38volatile int     init_ok = 0;
     39giet_barrier_t   barrier[10];
     40user_lock_t      tty_lock;   
    5141
    5242void bubbleSort(
     
    6353        int init_pos_result);
    6454
    65 ///////////////////////////////////////////////////////
    66 // This application supports at most 1024 processors
    67 // Number of barriers = log2(threads)
    68 
    69 giet_barrier_t barrier[10];
    70 
    7155//////////////////////////////////////////
    72 __attribute__ ((constructor)) void sort()
     56__attribute__ ((constructor)) void main()
     57//////////////////////////////////////////
    7358{
    74     int thread_id = giet_thread_id();
    7559    int * src_array = NULL;
    7660    int * dst_array = NULL;
    7761    int i;
    78    
    79     unsigned int time_start = giet_proctime();
    80     unsigned int time_end;   
    81 
    82     // compute number of threads (one thread per proc)
    8362    unsigned int x_size;
    8463    unsigned int y_size;
     
    8665    unsigned int threads;
    8766
     67    // each thread gets its thread_id
     68    int thread_id = giet_thread_id();
     69   
     70    unsigned int time_start = giet_proctime();
     71    unsigned int time_end;   
     72
     73    // each thread compute number of threads (one thread per proc)
    8874    giet_procs_number( &x_size , &y_size , &nprocs );
    8975    threads = x_size * y_size * nprocs;
    9076
     77    // thread 0 makes TTY and barrier initialisations
     78    // other threads wait initialisation completion.
     79    if ( thread_id == 0 )
     80    {
     81        // request a shared TTY used by all threads
     82        giet_tty_alloc(1);
     83       
     84        // TTY lock initialisation
     85        lock_init( &tty_lock );
     86
     87        printf("\n[ SORT T0 ] Starting sort application with %d threads "
     88                 "at cycle %d\n", threads, time_start);
     89
     90        // Barriers Initialization
     91        for (i = 0; i < __builtin_ctz( threads ); i++)
     92        {
     93            barrier_init( &barrier[i], threads >> i );
     94        }
     95
     96        init_ok = 1;
     97    }
     98    else
     99    {
     100        while( !init_ok );
     101    }
     102
     103    // each thread checks number of tasks
    91104    if ( (threads != 1)   && (threads != 2)   && (threads != 4)   &&
    92105         (threads != 8)   && (threads != 16 ) && (threads != 32)  &&
     
    94107         (threads != 512) && (threads != 1024) )
    95108    {
    96         task0_printf("[SORT ERROR] Number of processors must be power of 2\n"
    97                      "  x_size = %d / y_size = %d / nprocs = %d\n",
    98                      x_size , y_size , nprocs );
    99         giet_exit("error");
    100     }
    101 
    102     task0_printf("\n[ Thread 0 ] Starting sort application with %d threads "
    103                  "at cycle %d\n", threads, time_start);
    104 
    105     ///////////////////////////
    106     // Barriers Initialization
    107 
    108     if (thread_id == 0)
    109     {
    110         for (i = 0; i < __builtin_ctz( threads ); i++)
    111         {
    112             barrier_init(&barrier[i], threads >> i);
    113         }
    114 
    115         init_ok = 1;
    116     }
    117     else
    118     {
    119         while(!init_ok);
    120     }
    121 
    122     ////////////////////////
    123     // Array Initialization
    124 
     109        giet_exit("error : number of processors must be power of 2");
     110    }
     111
     112
     113    // Each thread contribute to Array Initialization
    125114    for (i = IPT * thread_id; i < IPT * (thread_id + 1); i++)
    126115    {
     
    128117    }
    129118
    130     ///////////////////////////////////
    131     // Parallel sort of array elements
    132 
    133     printf("[ Thread %d ] Stage 0: Sorting...\n\r", thread_id);
     119    // all threads contribute to the first stage of parallel sort
     120    printf("[ SORT T%d ] Stage 0: Sorting...\n\r", thread_id);
    134121
    135122    bubbleSort(array0, IPT, IPT * thread_id);
    136123
    137     printf("[ Thread %d ] Finishing Stage 0\n\r", thread_id);
    138 
     124    printf("[ SORT T%d ] Finishing Stage 0\n\r", thread_id);
     125
     126    // the number of threads is divided by 2 at each next stage
    139127    for (i = 0; i < __builtin_ctz( threads ); i++)
    140128    {
    141         barrier_wait(&barrier[i]);
     129        barrier_wait( &barrier[i] );
    142130
    143131        if((thread_id % (2 << i)) != 0)
    144132        {
    145             printf("[ Thread %d ] Quit\n\r", thread_id );
     133            printf("[ SORT T%d ] Quit\n\r", thread_id );
    146134            giet_exit("Completed");
    147135        }
    148136
    149         printf("[ Thread %d ] Stage %d: Sorting...\n\r", thread_id, i+1);
     137        printf("[ SORT T%d ] Stage %d: Sorting...\n\r", thread_id, i+1);
    150138
    151139        if((i % 2) == 0)
     
    167155                );
    168156
    169         printf("[ Thread %d ] Finishing Stage %d\n\r", thread_id, i + 1);
     157        printf("[ SORT T%d ] Finishing Stage %d\n\r", thread_id, i + 1);
    170158    }
    171159
     
    173161    int failure_index;
    174162
    175     //////////////////////////////
    176163    // Verify the resulting array
    177    
    178164    if(thread_id != 0)
    179165    {
     
    186172        if(dst_array[i] > dst_array[i+1])
    187173        {
    188 
    189174            success = 0;
    190175            failure_index = i;
     
    195180    time_end = giet_proctime();
    196181
    197     printf("[ Thread 0 ] Finishing sort application at cycle %d\n"
    198            "[ Thread 0 ] Time elapsed = %d\n",
     182    printf("[ SORT T0 ] Finishing sort application at cycle %d\n"
     183           "[ SORT T0 ] Time elapsed = %d\n",
    199184            time_end, (time_end - time_start) );
    200185
     
    205190    else
    206191    {
    207         printf("[ Thread 0 ] Failure!! Incorrect element: %d\n\r",
     192        printf("[ SORT T0 ] Failure!! Incorrect element: %d\n\r",
    208193               failure_index);
    209194        for(i=0; i<ARRAY_LENGTH; i++)
  • soft/giet_vm/applications/sort/sort.py

    r610 r669  
    4545
    4646    # create Vspace
    47     vspace = mapping.addVspace( name = 'sort', startname = 'sort_data' )
     47    vspace = mapping.addVspace( name = 'sort', startname = 'sort_data', active = False )
    4848
    4949    # data vseg : non local (only in cluster[0,0])
  • soft/giet_vm/applications/transpose/main.c

    r661 r669  
    3333#define CLUSTER_MAX           (X_MAX * Y_MAX)             // max number of clusters
    3434#define NN                    256                         // image size : nlines = npixels
    35 #define INITIAL_FILE_PATH     "misc/lena.raw"             // pathname on virtual disk
     35#define INITIAL_FILE_PATH     "/misc/lena_256.raw"        // pathname on virtual disk
    3636#define TRANSPOSED_FILE_PATH  "/home/lena_transposed.raw" // pathname on virtual disk
    3737#define RESTORED_FILE_PATH    "/home/lena_restored.raw"   // pathname on virtual disk
    3838#define INSTRUMENTATION_OK    1                           // display statistics on TTY
     39
     40// macro to use a shared TTY
     41#define printf(...)     lock_acquire( &tty_lock ); \
     42                        giet_tty_printf(__VA_ARGS__);  \
     43                        lock_release( &tty_lock )
    3944
    4045///////////////////////////////////////////////////////
     
    6166unsigned check_line_after[NN];
    6267
    63 // global synchronisation barrier
     68// lock protecting shared TTY
     69user_lock_t  tty_lock;
     70
     71// global & local synchronisation variables
    6472giet_sqt_barrier_t barrier;
    6573
     
    98106    unsigned int task_id       = (cluster_id * nprocs) + lpid;  // "continuous" task index
    99107
     108    // checking parameters
     109    giet_assert( ((nprocs == 1) || (nprocs == 2) || (nprocs == 4)),
     110                 "[TRANSPOSE ERROR] number of procs per cluster must be 1, 2 or 4");
     111
     112    giet_assert( ((x_size == 1) || (x_size == 2) || (x_size == 4) ||
     113                  (x_size == 8) || (x_size == 16)),
     114                 "[TRANSPOSE ERROR] x_size must be 1,2,4,8,16");
     115
     116    giet_assert( ((y_size == 1) || (y_size == 2) || (y_size == 4) ||
     117                  (y_size == 8) || (y_size == 16)),
     118                 "[TRANSPOSE ERROR] y_size must be 1,2,4,8,16");
     119
     120    giet_assert( (ntasks <= NN ),
     121                 "[TRANSPOSE ERROR] number of tasks larger than number of lines");
    100122
    101123    ///////////////////////////////////////////////////////////////////////
     
    107129    if ( (x==0) && (y==0) && (lpid==0) )
    108130    {
    109         if ((nprocs != 1) && (nprocs != 2) && (nprocs != 4))
    110         {
    111             giet_exit("[TRANSPOSE ERROR] number of procs per cluster must be 1, 2 or 4");
    112         }
    113         if ((nclusters != 1) && (nclusters != 2) && (nclusters != 4) &&
    114             (nclusters != 8) && (nclusters != 16) && (nclusters != 32) && (nclusters != 64) )
    115         {
    116             giet_exit("[TRANSPOSE ERROR] number of clusters must be 1,2,4,8,16,32,64");
    117         }
    118         if ( ntasks > NN )
    119         {
    120             giet_exit("[TRANSPOSE ERROR] number of tasks larger than number of lines");
    121         }
    122 
     131        // shared TTY allocation
     132        giet_tty_alloc( 1 );
     133
     134        // TTY lock initialisation
     135        lock_init( &tty_lock);
     136     
    123137        // distributed heap initialisation
    124138        unsigned int cx , cy;
     
    134148        sqt_barrier_init( &barrier, x_size , y_size , nprocs );
    135149
    136         giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] completes heap & barrier init at cycle %d\n",
    137                         giet_proctime() );
     150        printf("\n[TRANSPOSE] Proc [0,0,0] completes initialisation at cycle %d\n",
     151               giet_proctime() );
    138152
    139153        global_init_ok = 1;
     
    157171
    158172        if ( (x==0) && (y==0) )
    159         giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes buffer allocation"
    160                         " for cluster[%d,%d] at cycle %d\n"
    161                         " - buf_in  = %x\n"
    162                         " - buf_out = %x\n",
    163                         x, y, lpid, x, y, giet_proctime(),
    164                         (unsigned int)buf_in[cluster_id], (unsigned int)buf_out[cluster_id] );
     173        printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes buffer allocation"
     174               " for cluster[%d,%d] at cycle %d\n"
     175               " - buf_in  = %x\n"
     176               " - buf_out = %x\n",
     177               x, y, lpid, x, y, giet_proctime(),
     178               (unsigned int)buf_in[cluster_id], (unsigned int)buf_out[cluster_id] );
    165179
    166180        ///////////////////////////////////////////////////////////////////////
     
    173187        if ( fd_initial < 0 )
    174188        {
    175             giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot open file %s\n",
    176                             x , y , lpid , INITIAL_FILE_PATH );
     189            printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot open file %s\n",
     190                   x , y , lpid , INITIAL_FILE_PATH );
    177191            giet_exit(" open() failure");
    178192        }
    179193        else if ( (x==0) && (y==0) && (lpid==0) )
    180194        {
    181             giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file %s / fd = %d\n",
    182                             INITIAL_FILE_PATH , fd_initial );
     195            printf("\n[TRANSPOSE] Proc [0,0,0] open file %s / fd = %d\n",
     196                   INITIAL_FILE_PATH , fd_initial );
    183197        }
    184198
     
    187201        if ( fd_transposed < 0 )
    188202        {
    189             giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot open file %s\n",
     203            printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot open file %s\n",
    190204                            x , y , lpid , TRANSPOSED_FILE_PATH );
    191205            giet_exit(" open() failure");
     
    193207        else if ( (x==0) && (y==0) && (lpid==0) )
    194208        {
    195             giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file %s / fd = %d\n",
    196                             TRANSPOSED_FILE_PATH , fd_transposed );
     209            printf("\n[TRANSPOSE] Proc [0,0,0] open file %s / fd = %d\n",
     210                   TRANSPOSED_FILE_PATH , fd_transposed );
    197211        }
    198212
     
    201215        if ( fd_restored < 0 )
    202216        {
    203             giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot open file %s\n",
    204                             x , y , lpid , RESTORED_FILE_PATH );
     217            printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot open file %s\n",
     218                   x , y , lpid , RESTORED_FILE_PATH );
    205219            giet_exit(" open() failure");
    206220        }
    207221        else if ( (x==0) && (y==0) && (lpid==0) )
    208222        {
    209             giet_shr_printf("\n[TRANSPOSE] Proc [0,0,0] open file %s / fd = %d\n",
    210                             RESTORED_FILE_PATH , fd_restored );
     223            printf("\n[TRANSPOSE] Proc [0,0,0] open file %s / fd = %d\n",
     224                   RESTORED_FILE_PATH , fd_restored );
    211225        }
    212226
     
    244258                                 SEEK_SET ) != offset )
    245259            {
    246                 giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot seek fd = %d\n",
    247                                 x , y , lpid , fd_in );
     260                printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot seek fd = %d\n",
     261                       x , y , lpid , fd_in );
    248262                giet_exit(" seek() failure");
    249263            }
     
    254268                                pixels ) != pixels )
    255269            {
    256                 giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot read fd = %d\n",
    257                                 x , y , lpid , fd_in );
     270                printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot read fd = %d\n",
     271                       x , y , lpid , fd_in );
    258272                giet_exit(" read() failure");
    259273            }
    260274
    261275            if ( (x==0) && (y==0) )
    262             giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes load"
    263                             "  for iteration %d at cycle %d\n",
    264                             x, y, lpid, iteration, giet_proctime() );
     276            printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes load"
     277                   "  for iteration %d at cycle %d\n",
     278                   x, y, lpid, iteration, giet_proctime() );
    265279        }
    266280
     
    314328        }
    315329
    316         if ( lpid == 0 )
    317         {
    318             if ( (x==0) && (y==0) )
    319             giet_shr_printf("\n[TRANSPOSE] proc [%d,%d,0] completes transpose"
    320                             " for iteration %d at cycle %d\n",
    321                             x, y, iteration, giet_proctime() );
     330//        if ( lpid == 0 )
     331        {
     332//            if ( (x==0) && (y==0) )
     333            printf("\n[TRANSPOSE] proc [%d,%d,0] completes transpose"
     334                   " for iteration %d at cycle %d\n",
     335                   x, y, iteration, giet_proctime() );
    322336
    323337        }
     
    340354                             npt );
    341355
    342         if ( (x==0) && (y==0) && (lpid==0) )
    343         giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes display"
    344                         " for iteration %d at cycle %d\n",
    345                         x, y, lpid, iteration, giet_proctime() );
     356//        if ( (x==0) && (y==0) && (lpid==0) )
     357        printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes display"
     358               " for iteration %d at cycle %d\n",
     359               x, y, lpid, iteration, giet_proctime() );
    346360
    347361        DISP_END[x][y][lpid] = giet_proctime();
     
    364378                                 SEEK_SET ) != offset )
    365379            {
    366                 giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot seek fr = %d\n",
    367                                 x , y , lpid , fd_out );
     380                printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot seek fr = %d\n",
     381                       x , y , lpid , fd_out );
    368382                giet_exit(" seek() failure");
    369383            }
     
    374388                                 pixels ) != pixels )
    375389            {
    376                 giet_shr_printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot write fd = %d\n",
    377                                 x , y , lpid , fd_out );
     390                printf("\n[TRANSPOSE ERROR] Proc [%d,%d,%d] cannot write fd = %d\n",
     391                       x , y , lpid , fd_out );
    378392                giet_exit(" write() failure");
    379393            }
    380394
    381395            if ( (x==0) && (y==0) )
    382             giet_shr_printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes store"
    383                             "  for iteration %d at cycle %d\n",
    384                             x, y, lpid, iteration, giet_proctime() );
     396            printf("\n[TRANSPOSE] Proc [%d,%d,%d] completes store"
     397                   "  for iteration %d at cycle %d\n",
     398                   x, y, lpid, iteration, giet_proctime() );
    385399        }
    386400
     
    437451            }
    438452
    439             giet_shr_printf("\n   ---------------- Instrumentation Results ---------------------\n");
    440 
    441             giet_shr_printf(" - LOAD_START : min = %d / max = %d / med = %d / delta = %d\n",
    442                             min_load_start, max_load_start, (min_load_start+max_load_start)/2,
    443                             max_load_start-min_load_start);
    444 
    445             giet_shr_printf(" - LOAD_END   : min = %d / max = %d / med = %d / delta = %d\n",
    446                             min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2,
    447                             max_load_ended-min_load_ended);
    448 
    449             giet_shr_printf(" - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n",
    450                             min_trsp_start, max_trsp_start, (min_trsp_start+max_trsp_start)/2,
    451                             max_trsp_start-min_trsp_start);
    452 
    453             giet_shr_printf(" - TRSP_END   : min = %d / max = %d / med = %d / delta = %d\n",
    454                             min_trsp_ended, max_trsp_ended, (min_trsp_ended+max_trsp_ended)/2,
    455                             max_trsp_ended-min_trsp_ended);
    456 
    457             giet_shr_printf(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n",
    458                             min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2,
    459                             max_disp_start-min_disp_start);
    460 
    461             giet_shr_printf(" - DISP_END   : min = %d / max = %d / med = %d / delta = %d\n",
    462                             min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2,
    463                             max_disp_ended-min_disp_ended);
    464 
    465             giet_shr_printf(" - STOR_START : min = %d / max = %d / med = %d / delta = %d\n",
    466                             min_stor_start, max_stor_start, (min_stor_start+max_stor_start)/2,
    467                             max_stor_start-min_stor_start);
    468 
    469             giet_shr_printf(" - STOR_END   : min = %d / max = %d / med = %d / delta = %d\n",
    470                             min_stor_ended, max_stor_ended, (min_stor_ended+max_stor_ended)/2,
    471                             max_stor_ended-min_stor_ended);
     453            printf("\n   ---------------- Instrumentation Results ---------------------\n");
     454
     455            printf(" - LOAD_START : min = %d / max = %d / med = %d / delta = %d\n",
     456                   min_load_start, max_load_start, (min_load_start+max_load_start)/2,
     457                   max_load_start-min_load_start);
     458
     459            printf(" - LOAD_END   : min = %d / max = %d / med = %d / delta = %d\n",
     460                   min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2,
     461                   max_load_ended-min_load_ended);
     462
     463            printf(" - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n",
     464                   min_trsp_start, max_trsp_start, (min_trsp_start+max_trsp_start)/2,
     465                   max_trsp_start-min_trsp_start);
     466
     467            printf(" - TRSP_END   : min = %d / max = %d / med = %d / delta = %d\n",
     468                   min_trsp_ended, max_trsp_ended, (min_trsp_ended+max_trsp_ended)/2,
     469                   max_trsp_ended-min_trsp_ended);
     470
     471            printf(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n",
     472                   min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2,
     473                   max_disp_start-min_disp_start);
     474
     475            printf(" - DISP_END   : min = %d / max = %d / med = %d / delta = %d\n",
     476                   min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2,
     477                   max_disp_ended-min_disp_ended);
     478
     479            printf(" - STOR_START : min = %d / max = %d / med = %d / delta = %d\n",
     480                   min_stor_start, max_stor_start, (min_stor_start+max_stor_start)/2,
     481                   max_stor_start-min_stor_start);
     482
     483            printf(" - STOR_END   : min = %d / max = %d / med = %d / delta = %d\n",
     484                   min_stor_ended, max_stor_ended, (min_stor_ended+max_stor_ended)/2,
     485                   max_stor_ended-min_stor_ended);
    472486        }
    473487
     
    497511    }
    498512
    499     // clean up
    500     if ( (x==0) && (y == 0) && (lpid == 0) )
    501     {
    502         giet_fat_remove( "/home/lena_transposed" , 0 );
    503         giet_fat_remove( "/home/lena_restored" , 0 );
    504 
    505         giet_fat_remove( "/home" , 1 );
    506     }
    507    
    508513    giet_exit("Completed");
    509514
  • soft/giet_vm/applications/transpose/transpose.py

    r610 r669  
    4949
    5050    # create vspace
    51     vspace = mapping.addVspace( name = 'transpose', startname = 'trsp_data' )
     51    vspace = mapping.addVspace( name = 'transpose', startname = 'trsp_data', active = False )
    5252   
    5353    # data vseg : shared (only in cluster[0,0])
Note: See TracChangeset for help on using the changeset viewer.