@@ -377,7 +377,9 @@ void store_to_csv(const user_options_t& options,
377377 double max_time,
378378 double avg_time,
379379 double stddev,
380- double wait_avg_time) {
380+ double wait_avg_time,
381+ double algbw,
382+ double busbw) {
381383 std::ofstream csvf;
382384 csvf.open (options.csv_filepath , std::ofstream::out | std::ofstream::app);
383385
@@ -396,7 +398,7 @@ void store_to_csv(const user_options_t& options,
396398 << " ," << ccl::get_datatype_size (dtype) << " ," << elem_count << " ,"
397399 << ccl::get_datatype_size (dtype) * elem_count << " ," << buf_count << " ,"
398400 << iter_count << " ," << min_time << " ," << max_time << " ," << avg_time << " ,"
399- << stddev << " ," << wait_avg_time << std::endl;
401+ << stddev << " ," << wait_avg_time << " , " << algbw << " , " << busbw << std::endl;
400402 }
401403 csvf.close ();
402404 }
@@ -472,13 +474,42 @@ void print_timings(const ccl::communicator& comm,
472474 max_time /= iter_count;
473475
474476 size_t bytes = elem_count * ccl::get_datatype_size (dtype) * buf_count;
477+
478+ double algbw = bytes / total_avg_time / 1000 ;
479+
480+ if (ncolls == 1 ) {
481+ if (options.coll_names .front () == " allgather" ||
482+ options.coll_names .front () == " allgatherv" ||
483+ options.coll_names .front () == " reduce_scatter" ||
484+ options.coll_names .front () == " alltoall" ||
485+ options.coll_names .front () == " alltoallv" ) {
486+ algbw = algbw * nranks;
487+ }
488+ }
489+
490+ double busbw = algbw;
491+ if (ncolls == 1 ) {
492+ if (options.coll_names .front () == " allreduce" ) {
493+ busbw = algbw * 2 * (nranks - 1 ) / nranks;
494+ }
495+ else if (options.coll_names .front () == " allgather" ||
496+ options.coll_names .front () == " allgatherv" ||
497+ options.coll_names .front () == " reduce_scatter" ||
498+ options.coll_names .front () == " alltoall" ||
499+ options.coll_names .front () == " alltoallv" ) {
500+ busbw = algbw * (nranks - 1 ) / nranks;
501+ }
502+ }
503+
475504 std::stringstream ss;
476505 ss << std::right << std::fixed << std::setw (COL_WIDTH) << bytes << std::setw (COL_WIDTH)
477506 << elem_count * buf_count << std::setw (COL_WIDTH) << iter_count << std::setw (COL_WIDTH)
478507 << std::setprecision (COL_PRECISION) << min_time << std::setw (COL_WIDTH)
479508 << std::setprecision (COL_PRECISION) << max_time << std::setw (COL_WIDTH)
480509 << std::setprecision (COL_PRECISION) << total_avg_time << std::setw (COL_WIDTH - 3 )
481- << std::setprecision (COL_PRECISION) << stddev << std::setw (COL_WIDTH + 3 );
510+ << std::setprecision (COL_PRECISION) << stddev << std::setw (COL_WIDTH)
511+ << std::setprecision (COL_PRECISION) << algbw << std::setw (COL_WIDTH)
512+ << std::setprecision (COL_PRECISION) << busbw << std::setw (COL_WIDTH + 3 );
482513
483514 if (show_extened_info (options.show_additional_info )) {
484515 ss << std::right << std::fixed << std::setprecision (COL_PRECISION) << wait_avg_time;
@@ -497,7 +528,9 @@ void print_timings(const ccl::communicator& comm,
497528 max_time,
498529 total_avg_time,
499530 stddev,
500- wait_avg_time);
531+ wait_avg_time,
532+ algbw,
533+ busbw);
501534 }
502535 }
503536
0 commit comments