Skip to content

Commit

Permalink
kp_sampler_skip.cpp: Remove small changes not relating to this PR
Browse files Browse the repository at this point in the history
Fixing inconsistencies of diff with develop that shouldn't be there. These changes do not belong to this PR. They changes comprise primarily of minor changes with printed output. These unintended changes that I have taken out don't change any core logic or control flow in the program.
  • Loading branch information
vlkale authored May 3, 2024
1 parent 8d28cf6 commit e28dccd
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions common/kokkos-sampler/kp_sampler_skip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static endFunction endReduceCallee = NULL;

void kokkosp_request_tool_settings(const uint32_t,
Kokkos_Tools_ToolSettings* settings) {
settings->requires_global_fencing = 0;
settings->requires_global_fencing = false;
}

// set of functions from Kokkos ToolProgrammingInterface (includes fence)
Expand Down Expand Up @@ -102,7 +102,7 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
"deprecated variable. Please use KOKKOS_TOOLS_LIBS\n";
profileLibrary = getenv("KOKKOS_PROFILE_LIBRARY");
if (NULL == profileLibrary) {
std::cout << "KokkosP: No library to call in " << profileLibrary << '\n';
std::cout << "KokkosP: FATAL: No library to call in " << profileLibrary << "!\n";
exit(-1);
}
}
Expand All @@ -119,20 +119,20 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
nextLibrary = strtok(NULL, ";");

if (NULL == nextLibrary) {
std::cout << "KokkosP: No child library to call in " << profileLibrary
<< '\n';
std::cout << "KokkosP: FATAL: No child library to call in " << profileLibrary
<< "!\n";
exit(-1);
} else {
if (tool_verbosity > 0) {
std::cout << "KokkosP: Next library to call: " << nextLibrary << '\n';
std::cout << "KokkosP: Loading child library ..\n";
std::cout << "KokkosP: Next library to call: " << nextLibrary << "\n";
std::cout << "KokkosP: Loading child library of sampler..\n";
}

void* childLibrary = dlopen(nextLibrary, RTLD_NOW | RTLD_GLOBAL);

if (NULL == childLibrary) {
std::cerr << "KokkosP: Error: Unable to load: " << nextLibrary
<< " (Error=" << dlerror() << ")\n";
fprintf(stderr, "KokkosP: Error: Unable to load: %s (Error=%s)\n",
nextLibrary, dlerror());
exit(-1);
} else {
beginForCallee =
Expand Down Expand Up @@ -162,17 +162,17 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
if (tool_verbosity > 0) {
std::cout << "KokkosP: Function Status:\n";
std::cout << "KokkosP: begin-parallel-for: "
<< ((beginForCallee == NULL) ? "no" : "yes") << '\n';
<< ((beginForCallee == NULL) ? "no" : "yes") << "\n";
std::cout << "KokkosP: begin-parallel-scan: "
<< ((beginScanCallee == NULL) ? "no" : "yes") << '\n';
<< ((beginScanCallee == NULL) ? "no" : "yes") << "\n";
std::cout << "KokkosP: begin-parallel-reduce: "
<< ((beginReduceCallee == NULL) ? "no" : "yes") << '\n';
<< ((beginReduceCallee == NULL) ? "no" : "yes") << "\n";
std::cout << "KokkosP: end-parallel-for: "
<< ((endForCallee == NULL) ? "no" : "yes") << '\n';
<< ((endForCallee == NULL) ? "no" : "yes") << "\n";
std::cout << "KokkosP: end-parallel-scan: "
<< ((endScanCallee == NULL) ? "no" : "yes") << '\n';
<< ((endScanCallee == NULL) ? "no" : "yes") << "\n";
std::cout << "KokkosP: end-parallel-reduce: "
<< ((endReduceCallee == NULL) ? "no" : "yes") << '\n';
<< ((endReduceCallee == NULL) ? "no" : "yes") << "\n";
}
}
}
Expand Down Expand Up @@ -228,7 +228,7 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
tool_prob_num = 100.0;
kernelSampleSkip = atoi(tool_sample) + 1;
if (tool_verbosity > 0) {
std::cout << "KokkosP: Sampling rate set to: " << tool_sample << '\n';
std::cout << "KokkosP: Sampling rate set to: " << tool_sample << "\n";
}
return;
}
Expand Down Expand Up @@ -264,10 +264,10 @@ void kokkosp_begin_parallel_for(const char* name, const uint32_t devID,
std::cout << "KokkosP: sample " << *kID
<< " calling child-begin function...\n";
}
if (NULL != beginForCallee) {
if (tool_globFence) {
invoke_ktools_fence(0);
}
if (NULL != beginForCallee) {
uint64_t nestedkID = 0;
(*beginForCallee)(name, devID, &nestedkID);
if (tool_verbosity > 0) {
Expand All @@ -288,6 +288,7 @@ void kokkosp_end_parallel_for(const uint64_t kID) {
std::cout << "KokkosP: sample " << kID
<< " calling child-end function...\n";
}

if (tool_globFence) {
invoke_ktools_fence(0);
}
Expand Down

0 comments on commit e28dccd

Please sign in to comment.