[Openmp-commits] [openmp] r265437 - [STATS] Remove trailing whitespace in stats source files

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Tue Apr 5 11:48:49 PDT 2016


Author: jlpeyton
Date: Tue Apr  5 13:48:48 2016
New Revision: 265437

URL: http://llvm.org/viewvc/llvm-project?rev=265437&view=rev
Log:
[STATS] Remove trailing whitespace in stats source files

Modified:
    openmp/trunk/runtime/src/kmp_stats.cpp
    openmp/trunk/runtime/src/kmp_stats.h
    openmp/trunk/runtime/src/kmp_stats_timing.cpp
    openmp/trunk/runtime/src/kmp_stats_timing.h

Modified: openmp/trunk/runtime/src/kmp_stats.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_stats.cpp?rev=265437&r1=265436&r2=265437&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_stats.cpp (original)
+++ openmp/trunk/runtime/src/kmp_stats.cpp Tue Apr  5 13:48:48 2016
@@ -48,7 +48,7 @@ const kmp_stats_output_module::rgb_color
     {1.0, 0.0, 0.0}, // red
     {1.0, 0.6, 0.0}, // orange
     {1.0, 1.0, 0.0}, // yellow
-    {0.0, 1.0, 0.0}, // green 
+    {0.0, 1.0, 0.0}, // green
     {0.0, 0.0, 1.0}, // blue
     {0.6, 0.2, 0.8}, // purple
     {1.0, 0.0, 1.0}, // magenta
@@ -130,7 +130,7 @@ void statistic::scale(double factor)
 std::string statistic::format(char unit, bool total) const
 {
     std::string result = formatSI(sampleCount,9,' ');
-    
+
     if (sampleCount == 0)
     {
         result = result + std::string(", ") + formatSI(0.0, 9, unit);
@@ -155,8 +155,8 @@ std::string statistic::format(char unit,
 /* ********************************************************** */
 /* ************* explicitTimer member functions ************* */
 
-void explicitTimer::start(timer_e timerEnumValue) { 
-    startTime = tsc_tick_count::now(); 
+void explicitTimer::start(timer_e timerEnumValue) {
+    startTime = tsc_tick_count::now();
     if(timeStat::logEvent(timerEnumValue)) {
         __kmp_stats_thread_ptr->incrementNestValue();
     }
@@ -173,12 +173,12 @@ void explicitTimer::stop(timer_e timerEn
     stat->addSample ((finishTime - startTime).ticks());
 
     if(timeStat::logEvent(timerEnumValue)) {
-        __kmp_stats_thread_ptr->push_event(startTime.getValue() - __kmp_stats_start_time.getValue(), finishTime.getValue() - __kmp_stats_start_time.getValue(), __kmp_stats_thread_ptr->getNestValue(), timerEnumValue); 
+        __kmp_stats_thread_ptr->push_event(startTime.getValue() - __kmp_stats_start_time.getValue(), finishTime.getValue() - __kmp_stats_start_time.getValue(), __kmp_stats_thread_ptr->getNestValue(), timerEnumValue);
         __kmp_stats_thread_ptr->decrementNestValue();
     }
 
     /* We accept the risk that we drop a sample because it really did start at t==0. */
-    startTime = 0; 
+    startTime = 0;
     return;
 }
 
@@ -194,7 +194,7 @@ void kmp_stats_event_vector::deallocate(
 
 // This function is for qsort() which requires the compare function to return
 // either a negative number if event1 < event2, a positive number if event1 > event2
-// or zero if event1 == event2.  
+// or zero if event1 == event2.
 // This sorts by start time (lowest to highest).
 int compare_two_events(const void* event1, const void* event2) {
     kmp_stats_event* ev1 = (kmp_stats_event*)event1;
@@ -213,7 +213,7 @@ void kmp_stats_event_vector::sort() {
 /* ************* kmp_stats_list member functions ************* */
 
 // returns a pointer to newly created stats node
-kmp_stats_list* kmp_stats_list::push_back(int gtid) { 
+kmp_stats_list* kmp_stats_list::push_back(int gtid) {
     kmp_stats_list* newnode = (kmp_stats_list*)__kmp_allocate(sizeof(kmp_stats_list));
     // placement new, only requires space and pointer and initializes (so __kmp_allocate instead of C++ new[] is used)
     new (newnode) kmp_stats_list();
@@ -256,7 +256,7 @@ int kmp_stats_list::size() {
 /* ********************************************************************* */
 /* ************* kmp_stats_list::iterator member functions ************* */
 
-kmp_stats_list::iterator::iterator() : ptr(NULL) {} 
+kmp_stats_list::iterator::iterator() : ptr(NULL) {}
 kmp_stats_list::iterator::~iterator() {}
 kmp_stats_list::iterator kmp_stats_list::iterator::operator++() {
     this->ptr = this->ptr->next;
@@ -275,10 +275,10 @@ kmp_stats_list::iterator kmp_stats_list:
     return *this;
 }
 bool kmp_stats_list::iterator::operator!=(const kmp_stats_list::iterator & rhs) {
-   return this->ptr!=rhs.ptr; 
+   return this->ptr!=rhs.ptr;
 }
 bool kmp_stats_list::iterator::operator==(const kmp_stats_list::iterator & rhs) {
-   return this->ptr==rhs.ptr; 
+   return this->ptr==rhs.ptr;
 }
 kmp_stats_list* kmp_stats_list::iterator::operator*() const {
     return this->ptr;
@@ -294,7 +294,7 @@ int kmp_stats_output_module::printPerThr
 int kmp_stats_output_module::printPerThreadEventsFlag = 0;
 
 // init() is called very near the beginning of execution time in the constructor of __kmp_stats_global_output
-void kmp_stats_output_module::init() 
+void kmp_stats_output_module::init()
 {
     char * statsFileName  = getenv("KMP_STATS_FILE");
     eventsFileName        = getenv("KMP_STATS_EVENTS_FILE");
@@ -375,10 +375,10 @@ void kmp_stats_output_module::printEvent
     for (int i = 0; i < theEvents->size(); i++) {
         kmp_stats_event ev = theEvents->at(i);
         rgb_color color = getEventColor(ev.getTimerName());
-        fprintf(eventsOut, "%d %lu %lu %1.1f rgb(%1.1f,%1.1f,%1.1f) %s\n", 
-                gtid, 
-                ev.getStart(), 
-                ev.getStop(), 
+        fprintf(eventsOut, "%d %lu %lu %1.1f rgb(%1.1f,%1.1f,%1.1f) %s\n",
+                gtid,
+                ev.getStart(),
+                ev.getStop(),
                 1.2 - (ev.getNestLevel() * 0.2),
                 color.r, color.g, color.b,
                 timeStat::name(ev.getTimerName())
@@ -389,7 +389,7 @@ void kmp_stats_output_module::printEvent
 
 void kmp_stats_output_module::windupExplicitTimers()
 {
-    // Wind up any explicit timers. We assume that it's fair at this point to just walk all the explcit timers in all threads 
+    // Wind up any explicit timers. We assume that it's fair at this point to just walk all the explcit timers in all threads
     // and say "it's over".
     // If the timer wasn't running, this won't record anything anyway.
     kmp_stats_list::iterator it;
@@ -410,7 +410,7 @@ void kmp_stats_output_module::printPloti
                      "   scale: 1.0\n\n");
 
     fprintf(plotOut, "#proc getdata\n"
-                     "   file: %s\n\n", 
+                     "   file: %s\n\n",
                      eventsFileName);
 
     fprintf(plotOut, "#proc areadef\n"
@@ -418,7 +418,7 @@ void kmp_stats_output_module::printPloti
                      "   titledetails: align=center size=16\n"
                      "   rectangle: 1 1 13 9\n"
                      "   xautorange: datafield=2,3\n"
-                     "   yautorange: -1 %d\n\n", 
+                     "   yautorange: -1 %d\n\n",
                      size);
 
     fprintf(plotOut, "#proc xaxis\n"
@@ -432,7 +432,7 @@ void kmp_stats_output_module::printPloti
                      "   stubrange: 0 %d\n"
                      "   stubdetails: size=12\n"
                      "   label: Thread #\n"
-                     "   labeldetails: size=14\n\n", 
+                     "   labeldetails: size=14\n\n",
                      size-1);
 
     fprintf(plotOut, "#proc bars\n"
@@ -489,7 +489,7 @@ void kmp_stats_output_module::printHeade
 #endif
 }
 
-void kmp_stats_output_module::outputStats(const char* heading) 
+void kmp_stats_output_module::outputStats(const char* heading)
 {
     // Stop all the explicit timers in all threads
     // Do this before declaring the local statistics because thay have constructors so will take time to create.
@@ -532,7 +532,7 @@ void kmp_stats_output_module::outputStat
             // See if we should ignore this timer when aggregating
             if ((timeStat::masterOnly(s) && (t != 0)) || // Timer is only valid on the master and this thread is a worker
                 (timeStat::workerOnly(s) && (t == 0))    // Timer is only valid on a worker and this thread is the master
-               )            
+               )
             {
                 continue;
             }
@@ -615,9 +615,9 @@ void __kmp_accumulate_stats_at_exit(void
     __kmp_output_stats("Statistics on exit");
 }
 
-void __kmp_stats_init(void) 
+void __kmp_stats_init(void)
 {
 }
 
-} // extern "C" 
+} // extern "C"
 

Modified: openmp/trunk/runtime/src/kmp_stats.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_stats.h?rev=265437&r1=265436&r2=265437&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_stats.h (original)
+++ openmp/trunk/runtime/src/kmp_stats.h Tue Apr  5 13:48:48 2016
@@ -176,7 +176,7 @@ enum stats_flags_e {
     macro (USER_launch_thread_loop, stats_flags_e::logEvent, arg)       \
     macro (KMP_allocate_team, 0, arg)                                   \
     macro (KMP_setup_icv_copy, 0, arg)                                  \
-    macro (USER_icv_copy, 0, arg)                                       
+    macro (USER_icv_copy, 0, arg)
 #else
 # define KMP_FOREACH_DEVELOPER_TIMER(macro, arg)
 #endif
@@ -210,7 +210,7 @@ enum stats_flags_e {
 # define KMP_FOREACH_EXPLICIT_DEVELOPER_TIMER(macro, arg)               \
     macro(USER_launch_thread_loop, stats_flags_e::logEvent, arg)
 #else
-# define KMP_FOREACH_EXPLICIT_DEVELOPER_TIMER(macro, arg)               
+# define KMP_FOREACH_EXPLICIT_DEVELOPER_TIMER(macro, arg)
 #endif
 
 #define ENUMERATE(name,ignore,prefix) prefix##name,

Modified: openmp/trunk/runtime/src/kmp_stats_timing.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_stats_timing.cpp?rev=265437&r1=265436&r2=265437&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_stats_timing.cpp (original)
+++ openmp/trunk/runtime/src/kmp_stats_timing.cpp Tue Apr  5 13:48:48 2016
@@ -54,14 +54,14 @@ double tsc_tick_count::tick_time()
         char * start = &brand[0];
         for (;*start == ' '; start++)
             ;
-    
+
         char * end = brand + KMP_STRLEN(brand) - 3;
         uint64_t multiplier;
 
         if (*end == 'M') multiplier = 1000LL*1000LL;
         else if (*end == 'G') multiplier = 1000LL*1000LL*1000LL;
         else if (*end == 'T') multiplier = 1000LL*1000LL*1000LL*1000LL;
-        else 
+        else
         {
             cout << "Error determining multiplier '" << *end << "'\n";
             exit (-1);
@@ -69,9 +69,9 @@ double tsc_tick_count::tick_time()
         *end = 0;
         while (*end != ' ') end--;
         end++;
-    
+
         double freq = strtod(end, &start);
-        if (freq == 0.0) 
+        if (freq == 0.0)
         {
             cout << "Error calculating frequency " <<  end << "\n";
             exit (-1);
@@ -95,7 +95,7 @@ std::string formatSI(double interval, in
     if (useSI)
     {
         // Preserve accuracy for small numbers, since we only multiply and the positive powers
-        // of ten are precisely representable. 
+        // of ten are precisely representable.
         static struct { double scale; char prefix; } ranges[] = {
             {1.e12,'f'},
             {1.e9, 'p'},
@@ -112,7 +112,7 @@ std::string formatSI(double interval, in
             {1.e-24,'Z'},
             {1.e-27,'Y'}
         };
-        
+
         if (interval == 0.0)
         {
             os << std::setw(width-3) << std::right << "0.00" << std::setw(3) << unit;
@@ -125,13 +125,13 @@ std::string formatSI(double interval, in
             negative = true;
             interval = -interval;
         }
-        
+
         for (int i=0; i<(int)(sizeof(ranges)/sizeof(ranges[0])); i++)
         {
             if (interval*ranges[i].scale < 1.e0)
             {
                 interval = interval * 1000.e0 * ranges[i].scale;
-                os << std::fixed << std::setprecision(2) << std::setw(width-3) << std::right << 
+                os << std::fixed << std::setprecision(2) << std::setw(width-3) << std::right <<
                     (negative ? -interval : interval) << std::setw(2) << ranges[i].prefix << std::setw(1) << unit;
 
                 return os.str();

Modified: openmp/trunk/runtime/src/kmp_stats_timing.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_stats_timing.h?rev=265437&r1=265436&r2=265437&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_stats_timing.h (original)
+++ openmp/trunk/runtime/src/kmp_stats_timing.h Tue Apr  5 13:48:48 2016
@@ -56,11 +56,11 @@ class tsc_tick_count {
 #endif
     tsc_tick_count(int64_t value) : my_count(value) {};
     int64_t getValue() const { return my_count; }
-    tsc_tick_count later (tsc_tick_count const other) const { 
-        return my_count > other.my_count ? (*this) : other; 
+    tsc_tick_count later (tsc_tick_count const other) const {
+        return my_count > other.my_count ? (*this) : other;
     }
-    tsc_tick_count earlier(tsc_tick_count const other) const { 
-        return my_count < other.my_count ? (*this) : other; 
+    tsc_tick_count earlier(tsc_tick_count const other) const {
+        return my_count < other.my_count ? (*this) : other;
     }
 #if KMP_HAVE_TICK_TIME
     static double tick_time(); // returns seconds per cycle (period) of clock
@@ -69,13 +69,13 @@ class tsc_tick_count {
     friend tsc_tick_count::tsc_interval_t operator-(const tsc_tick_count t1, const tsc_tick_count t0);
 };
 
-inline tsc_tick_count::tsc_interval_t operator-(const tsc_tick_count t1, const tsc_tick_count t0) 
+inline tsc_tick_count::tsc_interval_t operator-(const tsc_tick_count t1, const tsc_tick_count t0)
 {
     return tsc_tick_count::tsc_interval_t( t1.my_count-t0.my_count );
 }
 
 #if KMP_HAVE_TICK_TIME
-inline double tsc_tick_count::tsc_interval_t::seconds() const 
+inline double tsc_tick_count::tsc_interval_t::seconds() const
 {
     return value*tick_time();
 }




More information about the Openmp-commits mailing list