diff --git a/src/apex/apex.cpp b/src/apex/apex.cpp index 4d4b5492..33c0bb87 100644 --- a/src/apex/apex.cpp +++ b/src/apex/apex.cpp @@ -65,9 +65,6 @@ #include #include #include "global_constructor_destructor.h" -#ifdef APEX_HAVE_HPX_disabled -static void apex_schedule_shutdown(void); -#endif // APEX_HAVE_HPX_disabled #endif // APEX_HAVE_HPX #if APEX_DEBUG @@ -165,8 +162,6 @@ static void finalize_hpx_runtime(void) { instance->query_runtime_counters(); } } - // Tell other localities to shutdown APEX - apex_schedule_shutdown(); // Shutdown APEX finalize(); hpx_finalized = true; @@ -2100,26 +2095,4 @@ static void apex_register_with_hpx(void) { } #endif -#ifdef APEX_HAVE_HPX_disabled -HPX_DECLARE_ACTION(APEX_TOP_LEVEL_PACKAGE::finalize, - apex_internal_shutdown_action); -HPX_ACTION_HAS_CRITICAL_PRIORITY(apex_internal_shutdown_action); -HPX_PLAIN_ACTION(APEX_TOP_LEVEL_PACKAGE::finalize, - apex_internal_shutdown_action); - -void apex_schedule_shutdown() { - if(get_hpx_runtime_ptr() == nullptr) return; - return; - //if(!thread_instance::is_worker()) return; - apex_internal_shutdown_action act; - try { - for(auto locality : hpx::find_all_localities()) { - hpx::apply(act, locality); - } - } catch(...) { - // what to do? - } -} -#endif - diff --git a/src/apex/profiler_listener.cpp b/src/apex/profiler_listener.cpp index 4d18ad32..8797b903 100644 --- a/src/apex/profiler_listener.cpp +++ b/src/apex/profiler_listener.cpp @@ -1726,14 +1726,6 @@ if (rc != 0) cout << "PAPI error! " << name << ": " << PAPI_strerror(rc) << endl } #ifdef APEX_HAVE_HPX -HPX_DECLARE_ACTION( - APEX_TOP_LEVEL_PACKAGE::profiler_listener::process_profiles_wrapper, - apex_internal_process_profiles_action); -HPX_ACTION_HAS_CRITICAL_PRIORITY(apex_internal_process_profiles_action); -HPX_PLAIN_ACTION( - APEX_TOP_LEVEL_PACKAGE::profiler_listener::process_profiles_wrapper, - apex_internal_process_profiles_action); - void apex_schedule_process_profiles() { if(get_hpx_runtime_ptr() == nullptr) return; if(!thread_instance::is_worker()) return; @@ -1741,9 +1733,8 @@ void apex_schedule_process_profiles() { APEX_TOP_LEVEL_PACKAGE::profiler_listener::process_profiles_wrapper(); } else { if(!consumer_task_running.test_and_set(memory_order_acq_rel)) { - apex_internal_process_profiles_action act; try { - hpx::apply(act, hpx::find_here()); + hpx::async(&profiler_listener::process_profiles_wrapper); } catch(...) { // During shutdown, we can't schedule a new task, // so we process profiles ourselves.