- Timestamp:
- May 16, 2011, 10:02:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/softs/soft_filter_giet/main.c
r162 r170 146 146 unsigned char* Z[256]; 147 147 148 // Arrays of pointers on the instrumentation arrays 149 // These arrays are indexed by the cluster index (sized for the worst case : 256 clusters) 150 // each pointer points on the base adress of an array of 4 (NPROCS max) unsigned int 151 unsigned int* LOAD_START[256]; 152 unsigned int* LOAD_ENDED[256]; 153 unsigned int* VERT_START[256]; 154 unsigned int* VERT_ENDED[256]; 155 unsigned int* HORI_START[256]; 156 unsigned int* HORI_ENDED[256]; 157 unsigned int* DISP_START[256]; 158 unsigned int* DISP_ENDED[256]; 159 148 160 // The shared, distributed buffers addresses are computed 149 161 // from the seg_heap_base value defined in the ldscript file … … 153 165 for( c=0 ; c<nclusters ; c++) 154 166 { 155 A[c] = (unsigned short*)(base + increment*c); 156 Z[c] = (unsigned char*) (base + 2*NP*NL/nclusters + increment*c); 157 B[c] = (int*) (base + 4*NP*NL/nclusters + increment*c); 158 C[c] = (int*) (base + 8*NP*NL/nclusters + increment*c); 159 D[c] = (int*) (base + 12*NP*NL/nclusters + increment*c); 167 A[c] = (unsigned short*) (base + increment*c); 168 Z[c] = (unsigned char*) (base + 2*NP*NL/nclusters + increment*c); 169 B[c] = (int*) (base + 4*NP*NL/nclusters + increment*c); 170 C[c] = (int*) (base + 8*NP*NL/nclusters + increment*c); 171 D[c] = (int*) (base + 12*NP*NL/nclusters + increment*c); 172 173 LOAD_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + increment*c); 174 LOAD_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 16 + increment*c); 175 VERT_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 32 + increment*c); 176 VERT_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 48 + increment*c); 177 HORI_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 64 + increment*c); 178 HORI_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 80 + increment*c); 179 DISP_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 96 + increment*c); 180 DISP_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 112 + increment*c); 160 181 } 161 182 … … 169 190 barrier_init(1, ntasks); 170 191 barrier_init(2, ntasks); 192 barrier_init(3, ntasks); 171 193 172 194 PRINTF("*** Completing barrier init at cycle %d ***\n", proctime()); … … 179 201 if ( lid == 0 ) 180 202 { 203 int p; 181 204 delta = proctime() - date; 182 205 date = date + delta; 183 206 PRINTF("\n*** Starting load at cycle %d (%d)\n", date, delta); 207 for ( p=0 ; p<nprocs ; p++ ) LOAD_START[cid][p] = date; 184 208 185 209 if( ioc_read(nblocks*cid/nclusters, … … 199 223 date = date + delta; 200 224 PRINTF("*** Completing load at cycle %d (%d)\n", date, delta); 225 for ( p=0 ; p<nprocs ; p++ ) LOAD_ENDED[cid][p] = date; 201 226 } 202 227 … … 215 240 date = date + delta; 216 241 PRINTF("\n*** Starting horizontal filter at cycle %d (%d)\n", date, delta); 242 HORI_START[cid][lid] = date; 217 243 218 244 // l = absolute line index / p = absolute pixel index … … 272 298 date = date + delta; 273 299 PRINTF("*** Completing horizontal filter at cycle %d (%d)\n", date, delta); 300 HORI_ENDED[cid][lid] = date; 274 301 275 302 barrier_wait(1); … … 286 313 date = date + delta; 287 314 PRINTF("\n*** starting vertical filter at cycle %d (%d)\n", date, delta); 315 VERT_START[cid][lid] = date; 288 316 289 317 // l = absolute line index / p = absolute pixel index … … 361 389 date = date + delta; 362 390 PRINTF("*** Completing vertical filter at cycle %d (%d)\n", date, delta); 391 VERT_ENDED[cid][lid] = date; 363 392 364 393 barrier_wait(2); … … 374 403 date = date + delta; 375 404 PRINTF("\n*** Starting display at cycle %d (%d)\n", date, delta); 405 DISP_START[cid][lid] = date; 376 406 377 407 first = lid*lines_per_task; … … 390 420 date = date + delta; 391 421 PRINTF("*** Completing display at cycle %d (%d)\n", date, delta); 422 DISP_ENDED[cid][lid] = date; 423 424 barrier_wait(3); 425 426 PRINTF("\n*** Starting Instrumentation at cycle %d (%d)\n\n", date, delta); 427 428 // Instrumentation (done by processor 0 in all clusters) 429 int cc, pp; 430 unsigned int min_load_start = 1000000000; 431 unsigned int max_load_start = 0; 432 unsigned int min_load_ended = 1000000000; 433 unsigned int max_load_ended = 0; 434 435 unsigned int min_hori_start = 1000000000; 436 unsigned int max_hori_start = 0; 437 unsigned int min_hori_ended = 1000000000; 438 unsigned int max_hori_ended = 0; 439 440 unsigned int min_vert_start = 1000000000; 441 unsigned int max_vert_start = 0; 442 unsigned int min_vert_ended = 1000000000; 443 unsigned int max_vert_ended = 0; 444 445 unsigned int min_disp_start = 1000000000; 446 unsigned int max_disp_start = 0; 447 unsigned int min_disp_ended = 1000000000; 448 unsigned int max_disp_ended = 0; 449 450 if ( lid == 0 ) 451 { 452 for ( cc=0 ; cc<nclusters ; cc++ ) 453 { 454 for ( pp=0 ; pp<nprocs ; pp++ ) 455 { 456 if ( LOAD_START[cc][pp] < min_load_start ) min_load_start = LOAD_START[cc][pp]; 457 if ( LOAD_START[cc][pp] > max_load_start ) max_load_start = LOAD_START[cc][pp]; 458 if ( LOAD_ENDED[cc][pp] < min_load_ended ) min_load_ended = LOAD_ENDED[cc][pp]; 459 if ( LOAD_ENDED[cc][pp] > max_load_ended ) max_load_ended = LOAD_ENDED[cc][pp]; 460 461 if ( HORI_START[cc][pp] < min_hori_start ) min_hori_start = HORI_START[cc][pp]; 462 if ( HORI_START[cc][pp] > max_hori_start ) max_hori_start = HORI_START[cc][pp]; 463 if ( HORI_ENDED[cc][pp] < min_hori_ended ) min_hori_ended = HORI_ENDED[cc][pp]; 464 if ( HORI_ENDED[cc][pp] > max_hori_ended ) max_hori_ended = HORI_ENDED[cc][pp]; 465 466 if ( VERT_START[cc][pp] < min_vert_start ) min_vert_start = VERT_START[cc][pp]; 467 if ( VERT_START[cc][pp] > max_vert_start ) max_vert_start = VERT_START[cc][pp]; 468 if ( VERT_ENDED[cc][pp] < min_vert_ended ) min_vert_ended = VERT_ENDED[cc][pp]; 469 if ( VERT_ENDED[cc][pp] > max_vert_ended ) max_vert_ended = VERT_ENDED[cc][pp]; 470 471 if ( DISP_START[cc][pp] < min_disp_start ) min_disp_start = DISP_START[cc][pp]; 472 if ( DISP_START[cc][pp] > max_disp_start ) max_disp_start = DISP_START[cc][pp]; 473 if ( DISP_ENDED[cc][pp] < min_disp_ended ) min_disp_ended = DISP_ENDED[cc][pp]; 474 if ( DISP_ENDED[cc][pp] > max_disp_ended ) max_disp_ended = DISP_ENDED[cc][pp]; 475 } 476 } 477 } 478 PRINTF(" - LOAD_START : min = %d / max = %d / med = %d / delta = %d\n", 479 min_load_start, max_load_start, (min_load_start+max_load_start)/2, max_load_start-min_load_start); 480 PRINTF(" - LOAD_END : min = %d / max = %d / med = %d / delta = %d\n", 481 min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2, max_load_ended-min_load_ended); 482 483 PRINTF(" - HORI_START : min = %d / max = %d / med = %d / delta = %d\n", 484 min_hori_start, max_hori_start, (min_hori_start+max_hori_start)/2, max_hori_start-min_hori_start); 485 PRINTF(" - HORI_END : min = %d / max = %d / med = %d / delta = %d\n", 486 min_hori_ended, max_hori_ended, (min_hori_ended+max_hori_ended)/2, max_hori_ended-min_hori_ended); 487 488 PRINTF(" - VERT_START : min = %d / max = %d / med = %d / delta = %d\n", 489 min_vert_start, max_vert_start, (min_vert_start+max_vert_start)/2, max_vert_start-min_vert_start); 490 PRINTF(" - VERT_END : min = %d / max = %d / med = %d / delta = %d\n", 491 min_vert_ended, max_vert_ended, (min_vert_ended+max_vert_ended)/2, max_vert_ended-min_vert_ended); 492 493 PRINTF(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n", 494 min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2, max_disp_start-min_disp_start); 495 PRINTF(" - DISP_END : min = %d / max = %d / med = %d / delta = %d\n", 496 min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2, max_disp_ended-min_disp_ended); 497 498 PRINTF(" - BARRIER LOAD/HORI = %d\n", min_hori_start - max_load_ended); 499 PRINTF(" - BARRIER HORI/VERT = %d\n", min_vert_start - max_hori_ended); 500 PRINTF(" - BARRIER VERT/DISP = %d\n", min_disp_start - max_vert_ended); 392 501 393 502 while(1);
Note: See TracChangeset
for help on using the changeset viewer.