Skip to content

Commit

Permalink
set new defaults of tool prob num and kernelSampleSkip
Browse files Browse the repository at this point in the history
maximum uInt64_t for kernelSampleSkip and -1.0 for tool prob num
  • Loading branch information
vlkale authored Sep 6, 2023
1 parent cf105ff commit a9cb706
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions common/kokkos-sampler/kp_sampler_skip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ namespace KokkosTools {
namespace Sampler {
static uint64_t uniqID = 0;
static uint64_t kernelSampleSkip =
101; // Default skip rate of every 100 invocations
std::numeric_limits<uint64_t>::max; // Default skip rate to max
static float tool_prob_num =
1.0; // Default probability of 1 percent of all invocations
-1.0; // Default probability of undefined percent of all invocations
static int tool_verbosity = 0;
static bool tool_globFence = 0;
static int tool_globFence = 0;

typedef void (*initFunction)(const int, const uint64_t, const uint32_t, void*);
typedef void (*finalizeFunction)();
Expand All @@ -33,11 +33,10 @@ static endFunction endReduceCallee = NULL;

void kokkosp_request_tool_settings(const uint32_t,
Kokkos_Tools_ToolSettings* settings) {
settings->requires_global_fencing = true;
if (tool_globFence) {
settings->requires_global_fencing = true;
if (0 == tool_globFence) {
settings->requires_global_fencing = 0;
} else {
settings->requires_global_fencing = false;
settings->requires_global_fencing = 1;
}
}

Expand All @@ -52,9 +51,9 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
tool_verbosity = 0;
}
if (NULL != tool_globFence_str) {
tool_globFence = (atoi(tool_global_fences) != 0);
tool_globFence = atoi(tool_global_fences);
} else {
tool_globFence = false;
tool_globFence = 0;
}

char* profileLibrary = getenv("KOKKOS_TOOLS_LIBS");
Expand Down Expand Up @@ -170,7 +169,7 @@ void kokkosp_init_library(const int loadSeq, const uint64_t interfaceVer,
"a Kokkos Kernel will be profiled.\n");
tool_prob_num = 0.0;
}
};
}

if (tool_verbosity > 0) {
printf("KokkosP: Sampling rate set to: %s\n", tool_sample);
Expand Down

0 comments on commit a9cb706

Please sign in to comment.