Skip to content

Commit

Permalink
Adding all GPU component events from PAPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Aug 12, 2019
1 parent 37a2878 commit b4c06bd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
1 change: 1 addition & 0 deletions cmake/tests/ompt_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
project(ompt_test)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}")
add_executable(ompt_test ompt_test.cpp)
5 changes: 5 additions & 0 deletions src/apex/proc_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void initialize_papi_events(void) {
char event_name[PAPI_MAX_STR_LEN];
retval = PAPI_event_code_to_name( code, event_name );
char *ss;
#if 0
// We need events that END in :power, etc.
/*
ss = strstr(event_name, ":allocated_memory"); // get position of this string.
Expand Down Expand Up @@ -125,6 +126,10 @@ void initialize_papi_events(void) {
printf("Found event '%s'\n", event_name); // Report what we found.
}
*/
#else
nvml_event_names.push_back(std::string(event_name)); // Valid! Remember the name.
printf("Found event '%s'\n", event_name); // Report what we found.
#endif
}
}
}
Expand Down
50 changes: 24 additions & 26 deletions src/apex/profiler_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ std::unordered_set<profile*> free_profiles;
return; // don't write out apex main timer
}
string shorter(action_name);
size_t maxlength = 30;
size_t maxlength = 41;
if (timer) maxlength = 52;
// to keep formatting pretty, trim any long timer names
if (shorter.size() > maxlength) {
Expand All @@ -490,7 +490,7 @@ std::unordered_set<profile*> free_profiles;
if (timer) {
screen_output << string_format("%52s", shorter.c_str()) << " : ";
} else {
screen_output << string_format("%30s", shorter.c_str()) << " : ";
screen_output << string_format("%41s", shorter.c_str()) << " : ";
}
#if defined(APEX_THROTTLE)
if (!apex_options::use_tau()) {
Expand Down Expand Up @@ -555,30 +555,26 @@ std::unordered_set<profile*> free_profiles;
screen_output << endl;
csv_output << endl;
} else {
if (action_name.find('%') == string::npos) {
screen_output << string_format(FORMAT_SCIENTIFIC,
p->get_minimum()) << " " ;
screen_output << string_format(FORMAT_SCIENTIFIC,
p->get_mean()) << " " ;
screen_output << string_format(FORMAT_SCIENTIFIC,
p->get_maximum()) << " " ;
screen_output << string_format(FORMAT_SCIENTIFIC,
p->get_accumulated()) << " " ;
screen_output << string_format(FORMAT_SCIENTIFIC,
p->get_stddev()) << " " ;
if (action_name.find('%') == string::npos && p->get_minimum() > 10000) {
screen_output << string_format(FORMAT_SCIENTIFIC, p->get_minimum()) << " " ;
} else {
screen_output << string_format(FORMAT_PERCENT,
p->get_minimum()) << " " ;
screen_output << string_format(FORMAT_PERCENT,
p->get_mean()) << " " ;
screen_output << string_format(FORMAT_PERCENT,
p->get_maximum()) << " " ;
screen_output << string_format(FORMAT_PERCENT,
p->get_accumulated()) << " " ;
screen_output << string_format(FORMAT_PERCENT,
p->get_stddev()) << " " ;
screen_output << string_format(FORMAT_PERCENT, p->get_minimum()) << " " ;
}
if (action_name.find('%') == string::npos && p->get_mean() > 10000) {
screen_output << string_format(FORMAT_SCIENTIFIC, p->get_mean()) << " " ;
} else {
screen_output << string_format(FORMAT_PERCENT, p->get_mean()) << " " ;
}
if (action_name.find('%') == string::npos && p->get_maximum() > 10000) {
screen_output << string_format(FORMAT_SCIENTIFIC, p->get_maximum()) << " " ;
} else {
screen_output << string_format(FORMAT_PERCENT, p->get_maximum()) << " " ;
}
if (action_name.find('%') == string::npos && p->get_stddev() > 10000) {
screen_output << string_format(FORMAT_SCIENTIFIC, p->get_stddev()) << " " ;
} else {
screen_output << string_format(FORMAT_PERCENT, p->get_stddev()) << " " ;
}
//screen_output << " --n/a-- " << endl;
screen_output << endl;
}
}
Expand Down Expand Up @@ -636,8 +632,10 @@ std::unordered_set<profile*> free_profiles;
}
}
if (id_vector.size() > 0) {
screen_output << "Counter : #samples "
<< "minimum | mean | maximum | total | stddev " << endl;
screen_output << "Counter : "
<< "#samples | minimum | mean | maximum | stddev " << endl;
//screen_output << "Counter : #samples | "
//<< "minimum | mean | maximum | total | stddev " << endl;
screen_output << "------------------------------------------"
<< "------------------------------------------------------" << endl;
std::sort(id_vector.begin(), id_vector.end());
Expand Down

0 comments on commit b4c06bd

Please sign in to comment.