Skip to content

Commit

Permalink
More verbose output fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Oct 1, 2024
1 parent b83ec90 commit 5fadebb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/apex/taskstubs_implementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int verbosePrint(const char *format, ...)
void safePrint(const char * format, tasktimer_guid_t guid, const char * event) {
//static std::mutex local_mtx;
//std::scoped_lock lock{local_mtx};
VERBOSE_PRINTF("%lu TS: %s: GUID %lu %s\n", apex::thread_instance::get_id(), format, guid, event);
VERBOSE_PRINTF("%lu TS: %s: GUID %p %s\n", apex::thread_instance::get_id(), format, guid, event);
return;
}

Expand Down Expand Up @@ -181,7 +181,7 @@ extern "C" {
tasktimer_argument_value_p arguments,
uint64_t argument_count) {
MAP_TASK(timer, apex_timer, "schedule");
VERBOSE_PRINTF("%lu TS: Scheduling: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Scheduling: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
static bool& over = apex::get_program_over();
if (over) return;
Expand All @@ -196,7 +196,7 @@ extern "C" {
tasktimer_execution_space_p) {
// TODO: capture the execution space, somehow...a new task?
MAP_TASK(timer, apex_timer, "start");
VERBOSE_PRINTF("%lu TS: Starting: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Starting: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
if (apex_timer != nullptr) {
apex::start(apex_timer);
Expand All @@ -208,7 +208,7 @@ extern "C" {
static bool& over = apex::get_program_over();
if (over) return;
MAP_TASK(timer, apex_timer, "yield");
VERBOSE_PRINTF("%lu TS: Yielding: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Yielding: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
if (apex_timer != nullptr) {
apex::yield(apex_timer);
Expand All @@ -221,7 +221,7 @@ extern "C" {
#if 1
// TODO: capture the execution space, somehow...a new task?
MAP_TASK(timer, apex_timer, "resume");
VERBOSE_PRINTF("%lu TS: Resuming: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Resuming: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
// TODO: why no resume function for task_wrapper objects?
if (apex_timer != nullptr) {
Expand All @@ -236,13 +236,13 @@ extern "C" {
static std::set<tasktimer_timer_t> stopped;
static std::mutex local_mtx;
MAP_TASK(timer, apex_timer, "stop");
VERBOSE_PRINTF("%lu TS: Stopping: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Stopping: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
if (apex_timer != nullptr) {
{
std::scoped_lock lock{local_mtx};
if (stopped.count(timer) > 0) {
VERBOSE_PRINTF("%lu TS: ERROR! TIMER STOPPED TWICE! : %lu\n", apex::thread_instance::get_id(), timer);
VERBOSE_PRINTF("%lu TS: ERROR! TIMER STOPPED TWICE! : %p\n", apex::thread_instance::get_id(), timer);
return;
}
stopped.insert(timer);
Expand All @@ -253,9 +253,10 @@ extern "C" {
void tasktimer_destroy_impl(
tasktimer_timer_t timer) {
MAP_TASK(timer, apex_timer, "destroy");
VERBOSE_PRINTF("%lu TS: Destroying: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Destroying: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
if (apex_timer != nullptr) {
//if (apex_timer->state == apex::task_wrapper::RUNNING) { apex::stop(apex_timer); }
// TODO: need to handle the destroy event somehow.
// definitely need to remove it from the local map.
safeErase(apex_timer->guid);
Expand All @@ -266,7 +267,7 @@ extern "C" {
const tasktimer_guid_t* parents, const uint64_t parent_count) {
// TODO: need to handle the add parents event
MAP_TASK(timer, apex_timer, "add parents");
VERBOSE_PRINTF("%lu TS: Adding parents: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Adding parents: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
if (apex_timer != nullptr) {
for (uint64_t i = 0 ; i < parent_count ; i++) {
Expand All @@ -288,7 +289,7 @@ extern "C" {
const tasktimer_guid_t* children, const uint64_t child_count) {
// TODO: need to handle the add children event
MAP_TASK(timer, apex_timer, "add children");
VERBOSE_PRINTF("%lu TS: Adding children: %lu %s\n", apex::thread_instance::get_id(), timer,
VERBOSE_PRINTF("%lu TS: Adding children: %p %s\n", apex::thread_instance::get_id(), timer,
apex_timer == nullptr ? "unknown" : apex_timer->task_id->get_name().c_str());
if (apex_timer != nullptr) {
for (uint64_t i = 0 ; i < child_count ; i++) {
Expand Down

0 comments on commit 5fadebb

Please sign in to comment.