{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
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);
/* ********************************************************** */
/* ************* 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();
}
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;
}
// 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;
/* ************* 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();
/* ********************************************************************* */
/* ************* 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;
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;
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");
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())
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;
" scale: 1.0\n\n");
fprintf(plotOut, "#proc getdata\n"
- " file: %s\n\n",
+ " file: %s\n\n",
eventsFileName);
fprintf(plotOut, "#proc areadef\n"
" 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"
" 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"
#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.
// 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;
}
__kmp_output_stats("Statistics on exit");
}
-void __kmp_stats_init(void)
+void __kmp_stats_init(void)
{
}
-} // extern "C"
+} // extern "C"