Skip to content

Commit

Permalink
Fixed problems with task dependency tracking
Browse files Browse the repository at this point in the history
And problems with HPX annotated functions.  However, still need
some work to resolve memory leaks of the task_wrapper objects.
  • Loading branch information
khuck committed May 11, 2018
1 parent 50a560c commit 2c7d564
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/apex/apex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ static void finalize_hpx_runtime(void) {
}
}
// Tell other localities to shutdown APEX
apex_schedule_shutdown();
//apex_schedule_shutdown();
// Shutdown APEX
finalize();
//finalize();
hpx_finalized = true;
FUNCTION_EXIT
}
Expand Down Expand Up @@ -459,7 +459,7 @@ profiler* start(const std::string &timer_name)
APEX_UTIL_REF_COUNT_APEX_INTERNAL_START
return profiler::get_disabled_profiler(); // don't process our own events - queue scrubbing tasks.
}
#ifdef APEX_HAVE_HPX
#ifdef APEX_HAVE_HPX_disabled
// Finalize at the _start_ of HPX shutdown so that we can stop any
// outstanding hpx::util::interval_timer instances. If any are left
// running, HPX shutdown will never complete.
Expand Down Expand Up @@ -880,7 +880,7 @@ void stop(task_wrapper * tt_ptr) {
}
}
// TODO - need to think about how to safely do this. The parent may finish before the child.
delete(tt_ptr);
//delete(tt_ptr);
}

void yield(profiler* the_profiler)
Expand Down
8 changes: 2 additions & 6 deletions src/apex/profiler_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,7 @@ node_color * get_node_color(double v,double vmin,double vmax)
#ifdef APEX_HAVE_HPX
num_worker_threads = num_worker_threads - num_non_worker_threads_registered;
#endif
double total_main = main_timer->elapsed() *
fmin(hardware_concurrency(), num_worker_threads);
//double total_main = main_timer->elapsed() * fmin(hardware_concurrency(), num_worker_threads);

// output nodes with "main" [shape=box; style=filled; fillcolor="#ff0000" ];
unordered_map<task_identifier, profile*>::const_iterator it;
Expand Down Expand Up @@ -901,9 +900,7 @@ node_color * get_node_color(double v,double vmin,double vmax)
profiler_listener * pl = inst->the_profiler_listener;
if (pl != nullptr) {
#ifdef APEX_TRACE_APEX
profiler * p = start("apex::process_profiles");
pl->process_profiles();
stop(p);
scoped_timer p("apex::process_profiles");
#else
pl->process_profiles();
#endif
Expand Down Expand Up @@ -1285,7 +1282,6 @@ if (rc != 0) cout << "PAPI error! " << name << ": " << PAPI_strerror(rc) << endl
// start the profiler object, which starts our timers
//std::shared_ptr<profiler> p = std::make_shared<profiler>(tt_ptr, is_resume);
// get the right task identifier, based on whether there are aliases
task_identifier * id = tt_ptr->get_task_id();
profiler * p = new profiler(tt_ptr, is_resume);
p->guid = thread_instance::get_guid();
thread_instance::instance().set_current_profiler(p);
Expand Down
1 change: 0 additions & 1 deletion src/apex/thread_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ std::unordered_set<std::string> thread_instance::open_profilers;
// Global static unordered map of parent GUIDs to child GUIDs
// to handle "overlapping timer" problem.
std::unordered_map<uint64_t, std::vector<profiler*>* > thread_instance::children_to_resume;
static std::mutex _profiler_stack_mutex;

thread_instance& thread_instance::instance(bool is_worker) {
if( _instance == nullptr ) {
Expand Down

0 comments on commit 2c7d564

Please sign in to comment.