Changeset 775 for soft/giet_vm/applications/transpose/transpose.c
- Timestamp:
- Feb 4, 2016, 5:05:56 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/transpose/transpose.c
r772 r775 47 47 #define PROCS_MAX 4 // max number of procs per cluster 48 48 #define CLUSTER_MAX (X_MAX * Y_MAX) // max number of clusters 49 #define IMAGE_SIZE 256// default image size50 #define INPUT_FILE_PATH "/misc/ lena_256.raw"// default input file pathname51 #define OUTPUT_FILE_PATH "/home/ lena_transposed.raw"// default output file pathname49 #define IMAGE_SIZE 128 // default image size 50 #define INPUT_FILE_PATH "/misc/images_128.raw" // default input file pathname 51 #define OUTPUT_FILE_PATH "/home/trsp_128.raw" // default output file pathname 52 52 #define INTERACTIVE 0 // interactive capture of filenames 53 #define VERBOSE 1// print comments on TTY53 #define VERBOSE 0 // print comments on TTY 54 54 55 55 … … 126 126 if ( p_id == 0 ) 127 127 { 128 // map buf_in and buf_out128 // map buf_in 129 129 unsigned int length = npixels / nclusters; 130 130 unsigned int offset = length * cluster_id; … … 144 144 145 145 if ( VERBOSE ) 146 printf("\n@@@ Thread[%d,%d,%d] call mmap for input file\n" 147 " length = %x / offset = %x / buf_in = %x\n", 148 x_id , y_id , p_id , length , offset , buf_in[cluster_id] ); 149 146 { 147 printf("\n@@@ Thread[%d,%d,%d] call mmap for input file\n" 148 " length = %x / offset = %x / buf_in = %x\n", 149 x_id , y_id , p_id , length , offset , buf_in[cluster_id] ); 150 } 151 152 // map buf_out 150 153 buf_out[cluster_id] = giet_fat_mmap( NULL, 151 154 length, … … 154 157 fd_out, 155 158 offset ); 159 156 160 if ( buf_out[cluster_id] == NULL ) 157 161 { … … 162 166 163 167 if ( VERBOSE ) 164 printf("\n@@@ Thread[%d,%d,%d] call mmap for output file\n" 165 " length = %x / offset = %x / buf_out = %x\n", 166 x_id , y_id , p_id , length , offset , buf_out[cluster_id] ); 168 { 169 printf("\n@@@ Thread[%d,%d,%d] call mmap for output file\n" 170 " length = %x / offset = %x / buf_out = %x\n", 171 x_id , y_id , p_id , length , offset , buf_out[cluster_id] ); 172 } 167 173 168 174 } … … 275 281 unsigned int max_disp_ended = 0; 276 282 283 char string[64]; 284 285 snprintf( string , 64 , "/home/transpose_%d_%d_%d" , x_size , y_size , nprocs ); 286 277 287 // open instrumentation file 278 unsigned int fd = giet_fat_open( "/home/transpose.inst" , O_CREAT);288 unsigned int fd = giet_fat_open( string , O_CREATE ); 279 289 if ( fd < 0 ) 280 290 { 281 printf("\n[TRANSPOSE ERROR] main cannot open file transpose.inst\n");291 printf("\n[TRANSPOSE ERROR] cannot open instrumentation file %s\n", string ); 282 292 giet_pthread_exit( NULL ); 283 293 } … … 305 315 } 306 316 307 printf("\n ---------------- Instrumentation Results ---------------------\n"); 308 309 printf(" - MMAP_START : min = %d / max = %d / med = %d / delta = %d\n", 317 giet_tty_printf( "\n ------ %s ------\n" , string ); 318 giet_fat_fprintf( fd , "\n ------ %s ------\n" , string ); 319 320 giet_tty_printf( " - MMAP_START : min = %d / max = %d / med = %d / delta = %d\n", 310 321 min_load_start, max_load_start, (min_load_start+max_load_start)/2, 311 max_load_start-min_load_start); 322 max_load_start-min_load_start ); 323 312 324 giet_fat_fprintf( fd , " - MMAP_START : min = %d / max = %d / med = %d / delta = %d\n", 313 325 min_load_start, max_load_start, (min_load_start+max_load_start)/2, 314 max_load_start-min_load_start );315 316 printf(" - MMAP_END : min = %d / max = %d / med = %d / delta = %d\n",326 max_load_start-min_load_start ); 327 328 giet_tty_printf( " - MMAP_END : min = %d / max = %d / med = %d / delta = %d\n", 317 329 min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2, 318 max_load_ended-min_load_ended); 330 max_load_ended-min_load_ended ); 331 319 332 giet_fat_fprintf( fd , " - MMAP_END : min = %d / max = %d / med = %d / delta = %d\n", 320 333 min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2, 321 max_load_ended-min_load_ended );322 323 printf(" - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n",334 max_load_ended-min_load_ended ); 335 336 giet_tty_printf( " - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n", 324 337 min_trsp_start, max_trsp_start, (min_trsp_start+max_trsp_start)/2, 325 max_trsp_start-min_trsp_start); 338 max_trsp_start-min_trsp_start ); 339 326 340 giet_fat_fprintf( fd , " - TRSP_START : min = %d / max = %d / med = %d / delta = %d\n", 327 341 min_trsp_start, max_trsp_start, (min_trsp_start+max_trsp_start)/2, 328 max_trsp_start-min_trsp_start );329 330 printf(" - TRSP_END : min = %d / max = %d / med = %d / delta = %d\n",342 max_trsp_start-min_trsp_start ); 343 344 giet_tty_printf( " - TRSP_END : min = %d / max = %d / med = %d / delta = %d\n", 331 345 min_trsp_ended, max_trsp_ended, (min_trsp_ended+max_trsp_ended)/2, 332 max_trsp_ended-min_trsp_ended); 346 max_trsp_ended-min_trsp_ended ); 347 333 348 giet_fat_fprintf( fd , " - TRSP_END : min = %d / max = %d / med = %d / delta = %d\n", 334 349 min_trsp_ended, max_trsp_ended, (min_trsp_ended+max_trsp_ended)/2, 335 max_trsp_ended-min_trsp_ended );336 337 printf(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n",350 max_trsp_ended-min_trsp_ended ); 351 352 giet_tty_printf( " - DISP_START : min = %d / max = %d / med = %d / delta = %d\n", 338 353 min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2, 339 max_disp_start-min_disp_start); 354 max_disp_start-min_disp_start ); 355 340 356 giet_fat_fprintf( fd , " - DISP_START : min = %d / max = %d / med = %d / delta = %d\n", 341 357 min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2, 342 max_disp_start-min_disp_start );343 344 printf(" - DISP_END : min = %d / max = %d / med = %d / delta = %d\n",358 max_disp_start-min_disp_start ); 359 360 giet_tty_printf( " - DISP_END : min = %d / max = %d / med = %d / delta = %d\n", 345 361 min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2, 346 max_disp_ended-min_disp_ended); 362 max_disp_ended-min_disp_ended ); 363 347 364 giet_fat_fprintf( fd , " - DISP_END : min = %d / max = %d / med = %d / delta = %d\n", 348 365 min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2, 349 max_disp_ended-min_disp_ended );366 max_disp_ended-min_disp_ended ); 350 367 351 368 giet_fat_close( fd ); … … 453 470 } 454 471 455 fd_out = giet_fat_open( output_file_name , O_CREAT ); // create if required472 fd_out = giet_fat_open( output_file_name , O_CREATE ); // create if required 456 473 if ( fd_out < 0 ) 457 474 {
Note: See TracChangeset
for help on using the changeset viewer.