@@ -408,10 +408,10 @@ void parsec_compute_best_unit( uint64_t length, float* updated_value, char** bes
408408
409409void parsec_devices_save_statistics (uint64_t * * pstats ) {
410410 if (NULL == * pstats ) {
411- * pstats = (uint64_t * )calloc (sizeof (uint64_t ), parsec_nb_devices * 6 /* see below for the number of arrays */ );
411+ * pstats = (uint64_t * )calloc (sizeof (uint64_t ), parsec_nb_devices * 7 /* see below for the number of arrays */ );
412412 }
413413 else {
414- memset (* pstats , 0 , parsec_nb_devices * sizeof (uint64_t ) * 6 );
414+ memset (* pstats , 0 , parsec_nb_devices * sizeof (uint64_t ) * 7 );
415415 }
416416 uint64_t * stats = * pstats ;
417417 uint64_t * executed_tasks = stats ;
@@ -420,12 +420,14 @@ void parsec_devices_save_statistics(uint64_t **pstats) {
420420 uint64_t * req_in = stats + 3 * parsec_nb_devices ;
421421 uint64_t * req_out = stats + 4 * parsec_nb_devices ;
422422 uint64_t * transfer_d2d = stats + 5 * parsec_nb_devices ;
423+ uint64_t * nb_evictions = stats + 6 * parsec_nb_devices ;
423424
424425 for (uint32_t i = 0 ; i < parsec_nb_devices ; i ++ ) {
425426 parsec_device_module_t * device = parsec_devices [i ];
426427 if (NULL == device ) continue ;
427428 assert ( i == device -> device_index );
428429 executed_tasks [i ] = device -> executed_tasks ;
430+ nb_evictions [i ] = device -> nb_evictions ;
429431 transfer_in [i ] = device -> data_in_from_device [0 ]; /* cpu-core device */
430432 transfer_out [i ] = device -> data_out_to_host ;
431433 req_in [i ] = device -> required_data_in ;
@@ -446,6 +448,7 @@ void parsec_devices_print_statistics(parsec_context_t *parsec_context, uint64_t
446448 uint64_t * end_stats = NULL ;
447449 uint64_t total_tasks = 0 , total_data_in = 0 , total_data_out = 0 ;
448450 uint64_t total_required_in = 0 , total_required_out = 0 , total_d2d = 0 ;
451+ uint64_t total_evicted = 0 ;
449452 float gtotal = 0.0 ;
450453 float best_data_in , best_data_out , best_d2d ;
451454 float best_required_in , best_required_out ;
@@ -457,7 +460,7 @@ void parsec_devices_print_statistics(parsec_context_t *parsec_context, uint64_t
457460 /* initialize the arrays */
458461 parsec_devices_save_statistics (& end_stats );
459462 if (NULL != start_stats ) {
460- for (i = 0 ; i < parsec_nb_devices * 6 ; i ++ ) {
463+ for (i = 0 ; i < parsec_nb_devices * 7 ; i ++ ) {
461464 assert (end_stats [i ] >= start_stats [i ]);
462465 end_stats [i ] -= start_stats [i ];
463466 }
@@ -468,6 +471,7 @@ void parsec_devices_print_statistics(parsec_context_t *parsec_context, uint64_t
468471 uint64_t * required_in = end_stats + 3 * parsec_nb_devices ;
469472 uint64_t * required_out = end_stats + 4 * parsec_nb_devices ;
470473 uint64_t * transferred_d2d = end_stats + 5 * parsec_nb_devices ;
474+ uint64_t * nb_evictions = end_stats + 6 * parsec_nb_devices ;
471475
472476 /* Compute total statistics */
473477 for (i = 0 ; i < parsec_nb_devices ; i ++ ) {
@@ -479,17 +483,18 @@ void parsec_devices_print_statistics(parsec_context_t *parsec_context, uint64_t
479483 total_required_in += required_in [i ];
480484 total_required_out += required_out [i ];
481485 total_d2d += transferred_d2d [i ];
486+ total_evicted += nb_evictions [i ];
482487 }
483488
484489 /* Print statistics */
485490 gtotal = (float )total_tasks ;
486491 double percent_in , percent_out , percent_d2d ;
487492
488- printf ("+----------------------------------------------------------------------------------------------------------------------------+\n" );
489- printf ("| | | Data In | Data Out |\n" );
490- printf ("|Rank %3d | # KERNEL | %% | Required | Transfered H2D(%%) | Transfered D2D(%%) | Required | Transfered(%%) |\n" ,
493+ printf ("+----------------------------------------------------------------------------------------------------------------------------------------------- +\n" );
494+ printf ("| | | Data In | Data Out | | \n" );
495+ printf ("|Rank %3d | # KERNEL | %% | Required | Transfered H2D(%%) | Transfered D2D(%%) | Required | Transfered(%%) | Evictions | \n" ,
491496 (NULL == parsec_context ? parsec_debug_rank : parsec_context -> my_rank ));
492- printf ("|---------|-----------|--------|------------|-----------------------|-----------------------|------------|-------------------|\n" );
497+ printf ("|---------|-----------|--------|------------|-----------------------|-----------------------|------------|-------------------|------------------| \n" );
493498 for ( i = 0 ; i < parsec_nb_devices ; i ++ ) {
494499 if ( NULL == (device = parsec_devices [i ]) ) continue ;
495500
@@ -503,15 +508,16 @@ void parsec_devices_print_statistics(parsec_context_t *parsec_context, uint64_t
503508 percent_d2d = (0 == required_in [i ])? nan ("" ): (((double )transferred_d2d [i ]) / (double )required_in [i ] ) * 100.0 ;
504509 percent_out = (0 == required_out [i ])? nan ("" ): (((double )transferred_out [i ]) / (double )required_out [i ] ) * 100.0 ;
505510
506- printf ("| Dev %2d |%10" PRIu64 " | %6.2f | %8.2f%2s | %8.2f%2s(%5.2f) | %8.2f%2s(%5.2f) | %8.2f%2s | %8.2f%2s(%5.2f) | %s\n" ,
511+ printf ("| Dev %2d |%10" PRIu64 " | %6.2f | %8.2f%2s | %8.2f%2s(%5.2f) | %8.2f%2s(%5.2f) | %8.2f%2s | %8.2f%2s(%5.2f) | %10" PRIu64 " | %s\n" ,
507512 device -> device_index , executed_tasks [i ], (executed_tasks [i ]/gtotal )* 100.00 ,
508513 best_required_in , required_in_unit , best_data_in , data_in_unit , percent_in ,
509514 best_d2d , d2d_unit , percent_d2d ,
510515 best_required_out , required_out_unit , best_data_out , data_out_unit , percent_out ,
516+ nb_evictions [i ],
511517 device -> name );
512518 }
513519
514- printf ("|---------|-----------|--------|------------|-----------------------|-----------------------|------------|-------------------|\n" );
520+ printf ("|---------|-----------|--------|------------|-----------------------|-----------------------|------------|-------------------|------------------| \n" );
515521
516522 parsec_compute_best_unit ( total_required_in , & best_required_in , & required_in_unit );
517523 parsec_compute_best_unit ( total_required_out , & best_required_out , & required_out_unit );
@@ -523,12 +529,13 @@ void parsec_devices_print_statistics(parsec_context_t *parsec_context, uint64_t
523529 percent_d2d = (0 == total_required_in )? nan ("" ): (((double )total_d2d ) / (double )total_required_in ) * 100.0 ;
524530 percent_out = (0 == total_required_out )? nan ("" ): (((double )total_data_out ) / (double )total_required_out ) * 100.0 ;
525531
526- printf ("|All Devs |%10" PRIu64 " | %6.2f | %8.2f%2s | %8.2f%2s(%5.2f) | %8.2f%2s(%5.2f) | %8.2f%2s | %8.2f%2s(%5.2f) |\n" ,
532+ printf ("|All Devs |%10" PRIu64 " | %6.2f | %8.2f%2s | %8.2f%2s(%5.2f) | %8.2f%2s(%5.2f) | %8.2f%2s | %8.2f%2s(%5.2f) | %10" PRIu64 " | \n" ,
527533 total_tasks , (total_tasks /gtotal )* 100.00 ,
528534 best_required_in , required_in_unit , best_data_in , data_in_unit , percent_in ,
529535 best_d2d , d2d_unit , percent_d2d ,
530- best_required_out , required_out_unit , best_data_out , data_out_unit , percent_out );
531- printf ("+----------------------------------------------------------------------------------------------------------------------------+\n" );
536+ best_required_out , required_out_unit , best_data_out , data_out_unit , percent_out ,
537+ total_evicted );
538+ printf ("+-----------------------------------------------------------------------------------------------------------------------------------------------+\n" );
532539
533540 parsec_devices_free_statistics (& end_stats );
534541}
@@ -545,6 +552,7 @@ void parsec_mca_device_reset_statistics(parsec_context_t *parsec_context) {
545552 device -> data_out_to_host = 0 ;
546553 device -> required_data_in = 0 ;
547554 device -> required_data_out = 0 ;
555+ device -> nb_evictions = 0 ;
548556 }
549557}
550558
0 commit comments