You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/01 19:04:23 UTC

[GitHub] anirudh2290 commented on a change in pull request #9932: Fixing couple of bugs in profiler

anirudh2290 commented on a change in pull request #9932: Fixing couple of bugs in profiler
URL: https://github.com/apache/incubator-mxnet/pull/9932#discussion_r171660539
 
 

 ##########
 File path: src/profiler/profiler.cc
 ##########
 @@ -205,19 +205,14 @@ void Profiler::DumpProfile(bool peform_cleanup) {
   // If aggregate stats aren't enabled, this won't cause a locked instruction
   std::shared_ptr<AggregateStats> ptr_aggregate_stats = aggregate_stats_.get()
                                                         ? aggregate_stats_ : nullptr;
-  bool first_flag = !first_pass && !num_records_emitted_;
   for (uint32_t i = 0; i < dev_num; ++i) {
     DeviceStats &d = profile_stat[i];
     ProfileStat *_opr_stat;
     while (d.opr_exec_stats_->try_dequeue(_opr_stat)) {
       CHECK_NOTNULL(_opr_stat);
       std::unique_ptr<ProfileStat> opr_stat(_opr_stat);  // manage lifecycle
       opr_stat->process_id_ = i;  // lie and set process id to be the device number
-      if (first_flag) {
-        first_flag = false;
-      } else {
-        file << ",\n";
-      }
+      file << ",\n";
 
 Review comment:
   Do we need this ? Also is there a reason not to use std::endl ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services