Autonomic Performance Environment for eXascale (APEX)  2.3.1
Classes | Functions
apex Namespace Reference

The main APEX namespace. More...

Classes

class  scoped_thread
 A convenience class for creating a scoped thread. More...
 
class  scoped_timer
 A convenience class for using APEX in C++ applications. More...
 
struct  task_wrapper
 A wrapper around APEX tasks. More...
 

Functions

static std::shared_ptr< task_wrappernull_task_wrapper (nullptr)
 declare a default "null" pointer for std::shared_ptr<task_wrapper>& references More...
 
uint64_t init (const char *thread_name, const uint64_t comm_rank, const uint64_t comm_size)
 Intialize APEX. More...
 
std::string dump (bool reset)
 Dump output from APEX. More...
 
void finalize (void)
 Finalize APEX. More...
 
void cleanup (void)
 Cleanup APEX. More...
 
profiler * start (const std::string &timer_name)
 Start a timer. More...
 
profiler * start (const apex_function_address function_address)
 Start a timer. More...
 
void start (std::shared_ptr< task_wrapper > task_wrapper_ptr)
 Start a timer. More...
 
void stop (profiler *the_profiler, bool cleanup=true)
 Stop a timer. More...
 
void stop (std::shared_ptr< task_wrapper > task_wrapper_ptr)
 Stop a timer. More...
 
void yield (profiler *the_profiler)
 Stop a timer, but don't increment the number of calls. More...
 
void yield (std::shared_ptr< task_wrapper > task_wrapper_ptr)
 Stop a timer, but don't increment the number of calls. More...
 
profiler * resume (const std::string &timer_name)
 Resume a timer. More...
 
profiler * resume (const apex_function_address function_address)
 Resume a timer. More...
 
void resume (std::shared_ptr< task_wrapper > task_wrapper_ptr)
 Resume a timer. More...
 
void reset (const std::string &timer_name)
 Reset a timer or counter. More...
 
void reset (apex_function_address function_address)
 Reset a timer. More...
 
void set_state (apex_thread_state state)
 Set the thread state. More...
 
void sample_value (const std::string &name, double value)
 Sample a state value. More...
 
std::shared_ptr< task_wrappernew_task (const std::string &name, const uint64_t task_id=UINTMAX_MAX, const std::shared_ptr< apex::task_wrapper > parent_task=null_task_wrapper)
 Create a new task (dependency). More...
 
std::shared_ptr< task_wrappernew_task (const apex_function_address function_address, const uint64_t task_id=UINTMAX_MAX, const std::shared_ptr< apex::task_wrapper > parent_task=null_task_wrapper)
 Create a new task (dependency). More...
 
std::shared_ptr< task_wrapperupdate_task (std::shared_ptr< task_wrapper > wrapper, const std::string &name)
 Update a task (dependency). More...
 
std::shared_ptr< task_wrapperupdate_task (std::shared_ptr< task_wrapper > wrapper, const apex_function_address function_address)
 Update a task wrapper (dependency). More...
 
apex_event_type register_custom_event (const std::string &name)
 Register an event type with APEX. More...
 
void custom_event (apex_event_type event_type, void *custom_data)
 Trigger a custom event. More...
 
std::string & version (void)
 Return the APEX version. More...
 
void register_thread (const std::string &name)
 Register a new thread. More...
 
void exit_thread (void)
 Exit a thread. More...
 
apex_policy_handle * register_policy (const apex_event_type when, std::function< int(apex_context const &)> f)
 Register a policy with APEX. More...
 
std::set< apex_policy_handle * > register_policy (std::set< apex_event_type > when, std::function< int(apex_context const &)> f)
 Register a policy with APEX. More...
 
apex_policy_handle * register_periodic_policy (unsigned long period, std::function< int(apex_context const &)> f)
 Register a policy with APEX. More...
 
apex_policy_handle * sample_runtime_counter (unsigned long period, const std::string &counter_name)
 Periodically sample a runtime counter. More...
 
void deregister_policy (apex_policy_handle *handle)
 Deregister a policy with APEX. More...
 
void stop_all_async_threads (void)
 Stop all asynchronous APEX background threads. More...
 
apex_profile * get_profile (apex_function_address function_address)
 Get the current profile for the specified function address. More...
 
apex_profile * get_profile (const std::string &timer_name)
 Get the current profile for the specified function address. More...
 
int setup_power_cap_throttling (void)
 Initialize the power cap throttling policy. More...
 
int setup_timer_throttling (apex_function_address the_address, apex_optimization_criteria_t criteria, apex_optimization_method_t method, unsigned long update_interval)
 Setup throttling to optimize for the specified function. More...
 
int setup_throughput_tuning (apex_function_address the_address, apex_optimization_criteria_t criteria, apex_event_type event_type, int num_inputs, long **inputs, long *mins, long *maxs, long *steps)
 Setup throttling to optimize for the specified function, using multiple input criteria. More...
 
apex_tuning_session_handle setup_custom_tuning (std::function< double(void)> metric, apex_event_type event_type, int num_inputs, long **inputs, long *mins, long *maxs, long *steps)
 Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria. More...
 
apex_tuning_session_handle setup_custom_tuning (apex_tuning_request &request)
 Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria of potentially multiple types. More...
 
int setup_timer_throttling (const std::string &the_name, apex_optimization_criteria_t criteria, apex_optimization_method_t method, unsigned long update_interval)
 Setup throttling to optimize for the specified function or counter. More...
 
int shutdown_throttling (void)
 Terminate the throttling policy. More...
 
int get_thread_cap (void)
 Get the current thread cap set by the throttling. More...
 
void set_thread_cap (int new_cap)
 Set the current thread cap for throttling. More...
 
std::vector< std::pair< std::string, long * > > & get_tunable_params (apex_tuning_session_handle h)
 Return a vector of the current tunable parameters. More...
 
bool has_session_converged (apex_tuning_session_handle handle)
 Check whether a tuning session has converged. More...
 
void get_best_values (apex_tuning_session_handle h)
 Set a tuning session's values to the best known values. More...
 
void print_options (void)
 Print out all configuration settings for APEX. More...
 
void send (uint64_t tag, uint64_t size, uint64_t target)
 Notify APEX that the current thread is sending a parcel/message to another rank/locality/process. More...
 
void recv (uint64_t tag, uint64_t size, uint64_t source_rank, uint64_t source_thread)
 Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process. More...
 

Detailed Description

The main APEX namespace.

The C++ interface for APEX uses the apex namespace. In comparison, The C interface has functions that start with "apex_".

Function Documentation

◆ cleanup()

void apex::cleanup ( void  )

Cleanup APEX.

Warning
For best results, this function should be explicitly called to free all memory allocated by APEX. If not explicitly called from the application or runtime, it will be automatically called when the APEX main singleton object is destructed. apex::finalize will be automatically called from apex::cleanup if it has not yet been called.

The cleanup method will free all allocated memory for APEX.

Returns
No return value.
See also
apex::init apex::finalize

◆ custom_event()

void apex::custom_event ( apex_event_type  event_type,
void *  custom_data 
)

Trigger a custom event.

This function will pass a custom event to the APEX event listeners. Each listeners' custom event handler will handle the custom event. Policy functions will be passed the custom event name in the event context.

Parameters
event_typeThe type of the custom event
custom_dataData specific to the custom event
Returns
No return value.
See also
apex::register_custom_event

◆ deregister_policy()

void apex::deregister_policy ( apex_policy_handle *  handle)

Deregister a policy with APEX.

This function will deregister the specified policy. In order to enable the policy again, it should be registered using apex::register_policy or apex::register_periodic_policy.

Parameters
handleThe handle of the policy to be deregistered.
See also
apex::register_policy, apex::register_periodic_policy

◆ dump()

std::string apex::dump ( bool  reset)

Dump output from APEX.

The stop measurement method will terminate all measurement and optionally:

  • print a report to the screen
  • write a profile to disk (if requested)
  • output all other visualization data
    Parameters
    resetWhether to reset all statistics
    Returns
    a string containing the output
    See also
    apex::finalize

◆ exit_thread()

void apex::exit_thread ( void  )

Exit a thread.

For multithreaded applications, exit this thread and clean up.

Warning
Failure to exit a thread with APEX may invalidate statistics.
Returns
No return value.

◆ finalize()

void apex::finalize ( void  )

Finalize APEX.

The stop measurement method will terminate all measurement and optionally:

  • print a report to the screen
  • write a profile to disk (if requested)
    Returns
    No return value.
    See also
    apex::init

◆ get_best_values()

void apex::get_best_values ( apex_tuning_session_handle  h)

Set a tuning session's values to the best known values.

Parameters
hThe handle for the tuning session of interest.

◆ get_profile() [1/2]

apex_profile* apex::get_profile ( apex_function_address  function_address)

Get the current profile for the specified function address.

This function will return the current profile for the specified address. Because profiles are updated out-of-band, it is possible that this profile value is out of date.

Parameters
function_addressThe address of the function.
Returns
The current profile for that timed function.

◆ get_profile() [2/2]

apex_profile* apex::get_profile ( const std::string &  timer_name)

Get the current profile for the specified function address.

This function will return the current profile for the specified address. Because profiles are updated out-of-band, it is possible that this profile value is out of date. This profile can be either a timer or a sampled value.

Parameters
timer_nameThe name of the function
Returns
The current profile for that timed function or sampled value.

◆ get_thread_cap()

int apex::get_thread_cap ( void  )

Get the current thread cap set by the throttling.

This function will return the current thread cap based on the throttling policy.

Returns
The current thread cap value.

◆ get_tunable_params()

std::vector<std::pair<std::string,long*> >& apex::get_tunable_params ( apex_tuning_session_handle  h)

Return a vector of the current tunable parameters.

Returns
A vector of pairs; the first element is the name of the tunable parameter, while the second is a pointer to its value.

◆ has_session_converged()

bool apex::has_session_converged ( apex_tuning_session_handle  handle)

Check whether a tuning session has converged.

Parameters
handleThe handle for the tuning session of interest.
Returns
true if the tuning session has converged, otherwise false

◆ init()

uint64_t apex::init ( const char *  thread_name,
const uint64_t  comm_rank,
const uint64_t  comm_size 
)

Intialize APEX.

Warning
For best results, this function should be called before any other APEX functions.
Use this version of apex::init when you do not have access to the input arguments.
Parameters
thread_nameThe name of the thread, or NULL. The lifetime of the thread will be timed with a timer using this same name.
comm_rankThe rank of this process within the full distributed application, i.e. MPI rank or HPX locality.
comm_sizeThe total number of processes within the full distributed application, i.e. MPI comm_size or total number of HPX localities.
Returns
APEX_NOERROR on success, or APEX_ERROR on failure.
See also
apex::init apex::finalize

◆ new_task() [1/2]

std::shared_ptr<task_wrapper> apex::new_task ( const apex_function_address  function_address,
const uint64_t  task_id = UINTMAX_MAX,
const std::shared_ptr< apex::task_wrapper parent_task = null_task_wrapper 
)

Create a new task (dependency).

This function will note a task dependency between the current timer (task) and the new task.

Parameters
function_addressThe function address of the timer.
task_idThe ID of the task (default of -1 implies none provided by runtime)
parent_taskThe apex::task_wrapper (if available) that is the parent task of this task
Returns
pointer to an apex::task_wrapper object

◆ new_task() [2/2]

std::shared_ptr<task_wrapper> apex::new_task ( const std::string &  name,
const uint64_t  task_id = UINTMAX_MAX,
const std::shared_ptr< apex::task_wrapper parent_task = null_task_wrapper 
)

Create a new task (dependency).

This function will note a task dependency between the current timer (task) and the new task.

Parameters
nameThe name of the timer.
task_idThe ID of the task (default of UINTMAX_MAX implies none provided by runtime)
parent_taskThe apex::task_wrapper (if available) that is the parent task of this task
Returns
pointer to an apex::task_wrapper object

◆ null_task_wrapper()

static std::shared_ptr<task_wrapper> apex::null_task_wrapper ( nullptr  )
static

declare a default "null" pointer for std::shared_ptr<task_wrapper>& references

See also
apex::task_wrapper

◆ print_options()

void apex::print_options ( void  )

Print out all configuration settings for APEX.

◆ recv()

void apex::recv ( uint64_t  tag,
uint64_t  size,
uint64_t  source_rank,
uint64_t  source_thread 
)

Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process.

This method notifies APEX that the current thread is receiving a parcel/message from another rank/locality/process. The tag is meant to be an identifier for the message, not required to be unique. The source value is the APEX rank of the source of the message.

Parameters
tagThe message identifier
sizeThe message size (in bytes)
source_rankThe message source (as a rank/locality index)
source_threadThe message source (as a worker index - 0 if unknown)

◆ register_custom_event()

apex_event_type apex::register_custom_event ( const std::string &  name)

Register an event type with APEX.

Create a user-defined event type for APEX.

Parameters
nameThe name of the custom event
Returns
The index of the custom event.
See also
apex::custom_event

◆ register_periodic_policy()

apex_policy_handle* apex::register_periodic_policy ( unsigned long  period,
std::function< int(apex_context const &)>  f 
)

Register a policy with APEX.

Apex provides the ability to call an application-specified function periodically. This assigns the passed in function to be called on a periodic basis. The context for the event will be passed to the registered function.

Parameters
periodHow frequently the function should be called (in microseconds)
fThe function to be called when that event is handled by APEX.
Returns
A handle to the policy, to be stored if the policy is to be un-registered later.

◆ register_policy() [1/2]

apex_policy_handle* apex::register_policy ( const apex_event_type  when,
std::function< int(apex_context const &)>  f 
)

Register a policy with APEX.

Apex provides the ability to call an application-specified function when certain events occur in the APEX library, or periodically. This assigns the passed in function to the event, so that when that event occurs in APEX, the function is called. The context for the event will be passed to the registered function.

Parameters
whenThe APEX event when this function should be called
fThe function to be called when that event is handled by APEX.
Returns
A handle to the policy, to be stored if the policy is to be un-registered later.
See also
apex::deregister_policy, apex::register_periodic_policy

◆ register_policy() [2/2]

std::set<apex_policy_handle*> apex::register_policy ( std::set< apex_event_type when,
std::function< int(apex_context const &)>  f 
)

Register a policy with APEX.

Apex provides the ability to call an application-specified function when certain events occur in the APEX library, or periodically. This assigns the passed in function to the event, so that when that event occurs in APEX, the function is called. The context for the event will be passed to the registered function.

Parameters
whenThe set of APEX events when this function should be called
fThe function to be called when that event is handled by APEX.
Returns
A handle to the policy, to be stored if the policy is to be un-registered later.
See also
apex::deregister_policy, apex::register_periodic_policy

◆ register_thread()

void apex::register_thread ( const std::string &  name)

Register a new thread.

For multithreaded applications, register a new thread with APEX.

Warning
Failure to register a thread with APEX may invalidate statistics, and may prevent the ability to use timers or sampled values for this thread.
Parameters
nameThe name that will be assigned to the new thread.
Returns
No return value.

◆ reset() [1/2]

void apex::reset ( apex_function_address  function_address)

Reset a timer.

This function will reset the profile associated with the specified timer to zero.

Parameters
function_addressThe function address of the timer.
Returns
No return value.

◆ reset() [2/2]

void apex::reset ( const std::string &  timer_name)

Reset a timer or counter.

This function will reset the profile associated with the specified timer or counter name to zero.

Parameters
timer_nameThe name of the timer.
Returns
No return value.
See also
apex::get_profile

◆ resume() [1/3]

profiler* apex::resume ( const apex_function_address  function_address)

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associated with the address passed in to this function. The difference between this function and the apex::start function is that the number of calls to that timer will not be incremented.

Parameters
function_addressThe address of the function to be timed
Returns
The handle for the timer object in APEX. Not intended to be queried by the application. Should be retained locally, if possible, and passed in to the matching apex::stop call when the timer should be stopped.
See also
apex::stop, apex::yield, apex::start

◆ resume() [2/3]

profiler* apex::resume ( const std::string &  timer_name)

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associated with the name passed in to this function. The difference between this function and the apex::start function is that the number of calls to that timer will not be incremented.

Parameters
timer_nameThe name of the timer.
Returns
The handle for the timer object in APEX. Not intended to be queried by the application. Should be retained locally, if possible, and passed in to the matching apex::stop() call when the timer should be stopped.
See also
apex::stop, apex::yield, apex::start

◆ resume() [3/3]

void apex::resume ( std::shared_ptr< task_wrapper task_wrapper_ptr)

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associated with the address passed in to this function. The difference between this function and the apex::start function is that the number of calls to that timer will not be incremented.

Parameters
task_wrapper_ptrA pointer to an apex::task_wrapper created by apex::new_task. APEX will use this to store the profiler data.
Returns
No return value.
See also
apex::stop, apex::yield, apex::start

◆ sample_runtime_counter()

apex_policy_handle* apex::sample_runtime_counter ( unsigned long  period,
const std::string &  counter_name 
)

Periodically sample a runtime counter.

Apex provides the ability to call an application-specified function periodically. This assigns the passed in function to be called on a periodic basis. The context for the event will be passed to the registered function.

Parameters
periodHow frequently the counter should be called (in microseconds)
counter_nameThe name of the counter to sample
Returns
A handle to the policy, to be stored if the policy is to be un-registered later.

◆ sample_value()

void apex::sample_value ( const std::string &  name,
double  value 
)

Sample a state value.

This function will retain a sample of some value. The profile for this sampled value will store the min, mean, max, total and standard deviation for this value for all times it is sampled.

Parameters
nameThe name of the sampled value
valueThe sampled value
Returns
No return value.

◆ send()

void apex::send ( uint64_t  tag,
uint64_t  size,
uint64_t  target 
)

Notify APEX that the current thread is sending a parcel/message to another rank/locality/process.

This method notifies APEX that the current thread is sending a parcel/message to another rank/locality/process. The tag is meant to be an identifier for the message, not required to be unique. The target value is the APEX rank of the target of the message.

Parameters
tagThe message identifier
sizeThe message size (in bytes)
targetThe message target (as an APEX rank)

◆ set_state()

void apex::set_state ( apex_thread_state  state)

Set the thread state.

This function will set the thread state in APEX for 3rd party observation

Parameters
stateThe state of the thread.
Returns
No return value.

◆ set_thread_cap()

void apex::set_thread_cap ( int  new_cap)

Set the current thread cap for throttling.

This function will set the current thread cap based on an external throttling policy.

Parameters
new_capThe current thread cap value.

◆ setup_custom_tuning() [1/2]

apex_tuning_session_handle apex::setup_custom_tuning ( apex_tuning_request &  request)

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria of potentially multiple types.

This function will initialize a policy to optimize a custom metric, using metric and parameters specified in the tuning request. The system tries to minimize the custom metric.

Parameters
requestAn apex_tuning_request object that specifies the tuning parameters.
Returns
A handle to the tuning session.

◆ setup_custom_tuning() [2/2]

apex_tuning_session_handle apex::setup_custom_tuning ( std::function< double(void)>  metric,
apex_event_type  event_type,
int  num_inputs,
long **  inputs,
long *  mins,
long *  maxs,
long *  steps 
)

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria.

This function will initialize a policy to optimize a custom metric, using the list of tunable parameters. The system tries to minimize the custom metric. After evaluating the state of the system, the policy will assign new values to the inputs.

Parameters
metricA function returning the value to be minimized.
event_typeThe apex_event_type that should trigger this policy
num_inputsThe number of tunable inputs for optimization
inputsAn array of addresses to inputs for optimization
minsAn array of minimum values for each input
maxsAn array of maximum values for each input
stepsAn array of step values for each input
Returns
A handle to the tuning session

◆ setup_power_cap_throttling()

int apex::setup_power_cap_throttling ( void  )

Initialize the power cap throttling policy.

This function will initialize APEX for power cap throttling. There are several environment variables that control power cap throttling:

HPX_THROTTLING
If set, throttling will be enabled and initialized at startup.
APEX_THROTTLING_MAX_THREADS
The maximum number of threads the throttling system will allow. The default value is 48.
APEX_THROTTLING_MIN_THREADS
The minimum number of threads the throttling system will allow. The default value is 12.
APEX_THROTTLING_MAX_WATTS
The maximum number of Watts the system can consume as an average rate. The default value is 220.
APEX_THROTTLING_MIN_WATTS
The minimum number of Watts the system can consume as an average rate. The default value is 180.
HPX_ENERGY_THROTTLING
If set, power/energy throttling will be performed.
HPX_ENERGY
TBD

After evaluating the state of the system, the policy will set the thread cap, which can be queried using apex::get_thread_cap().

Returns
APEX_NOERROR on success, otherwise an error code.

◆ setup_throughput_tuning()

int apex::setup_throughput_tuning ( apex_function_address  the_address,
apex_optimization_criteria_t  criteria,
apex_event_type  event_type,
int  num_inputs,
long **  inputs,
long *  mins,
long *  maxs,
long *  steps 
)

Setup throttling to optimize for the specified function, using multiple input criteria.

This function will initialize a policy to optimize the specified function, using the list of tunable inputs for the specified function. The optimization criteria include maximizing throughput, minimizing or maximizing time spent in the specified function. After evaluating the state of the system, the policy will assign new values to the inputs.

Parameters
the_addressThe address of the function to be optimized.
criteriaThe optimization criteria.
event_typeThe apex_event_type that should trigger this policy
num_inputsThe number of tunable inputs for optimization
inputsAn array of addresses to inputs for optimization
minsAn array of minimum values for each input
maxsAn array of maximum values for each input
stepsAn array of step values for each input
Returns
APEX_NOERROR on success, otherwise an error code.

◆ setup_timer_throttling() [1/2]

int apex::setup_timer_throttling ( apex_function_address  the_address,
apex_optimization_criteria_t  criteria,
apex_optimization_method_t  method,
unsigned long  update_interval 
)

Setup throttling to optimize for the specified function.

This function will initialize the throttling policy to optimize for the specified function. The optimization criteria include maximizing throughput, minimizing or maximizing time spent in the specified function. After evaluating the state of the system, the policy will set the thread cap, which can be queried using apex::get_thread_cap().

Parameters
the_addressThe address of the function to be optimized.
criteriaThe optimization criteria.
methodThe optimization method.
update_intervalThe time between observations, in microseconds.
Returns
APEX_NOERROR on success, otherwise an error code.

◆ setup_timer_throttling() [2/2]

int apex::setup_timer_throttling ( const std::string &  the_name,
apex_optimization_criteria_t  criteria,
apex_optimization_method_t  method,
unsigned long  update_interval 
)

Setup throttling to optimize for the specified function or counter.

This function will initialize the throttling policy to optimize for the specified function or counter. The optimization criteria include maximizing throughput, minimizing or maximizing time spent in the specified function or value sampled in the counter. After evaluating the state of the system, the policy will set the thread cap, which can be queried using apex::get_thread_cap().

Parameters
the_nameThe name of the function or counter to be optimized.
criteriaThe optimization criteria.
methodThe optimization method.
update_intervalThe time between observations, in microseconds.
Returns
APEX_NOERROR on success, otherwise an error code.

◆ shutdown_throttling()

int apex::shutdown_throttling ( void  )

Terminate the throttling policy.

This function will terminate the throttling policy.

Returns
APEX_NOERROR on success, otherwise an error code.

◆ start() [1/3]

profiler* apex::start ( const apex_function_address  function_address)

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associated with the address passed in to this function.

Parameters
function_addressThe address of the function to be timed
Returns
The handle for the timer object in APEX. Not intended to be queried by the application. Should be retained locally, if possible, and passed in to the matching apex::stop call when the timer should be stopped.
See also
apex::stop, apex::yield, apex::resume

◆ start() [2/3]

profiler* apex::start ( const std::string &  timer_name)

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associated with the name passed in to this function.

Parameters
timer_nameThe name of the timer.
Returns
The handle for the timer object in APEX. Not intended to be queried by the application. Should be retained locally, if possible, and passed in to the matching apex::stop() call when the timer should be stopped.
See also
apex::stop, apex::yield, apex::resume

◆ start() [3/3]

void apex::start ( std::shared_ptr< task_wrapper task_wrapper_ptr)

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associated with the task_wrapper passed in to this function.

Parameters
task_wrapper_ptrA pointer to an apex::task_wrapper created by apex::new_task. APEX will use this to store the profiler data.
Returns
No return value.
See also
apex::stop, apex::yield, apex::resume apex::new_task

◆ stop() [1/2]

void apex::stop ( profiler *  the_profiler,
bool  cleanup = true 
)

Stop a timer.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timer value will eventually added to the profile for the process.

Parameters
the_profilerThe handle of the profiler object.
cleanupInternal use only.
Returns
No return value.
See also
apex::start, apex::yield, apex::resume

◆ stop() [2/2]

void apex::stop ( std::shared_ptr< task_wrapper task_wrapper_ptr)

Stop a timer.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timer value will eventually added to the profile for the process.

Parameters
task_wrapper_ptran apex::task_wrapper pointer that was started
Returns
No return value.
See also
apex::start, apex::yield, apex::resume, apex::new_task

◆ stop_all_async_threads()

void apex::stop_all_async_threads ( void  )

Stop all asynchronous APEX background threads.

This function will stop all background threads from all listeners, and force them to exit. This is necessary for stopping perodic policies that would otherwise prevent runtimes from finishing work and calling apex::finalize().

See also
apex::deregister_policy, apex::register_policy apex::finalize

◆ update_task() [1/2]

std::shared_ptr<task_wrapper> apex::update_task ( std::shared_ptr< task_wrapper wrapper,
const apex_function_address  function_address 
)

Update a task wrapper (dependency).

This function will update the function address that this task wrapper refers to.

Parameters
wrapperThe existing apex::task_wrapper object
function_addressThe new function address of the timer.

◆ update_task() [2/2]

std::shared_ptr<task_wrapper> apex::update_task ( std::shared_ptr< task_wrapper wrapper,
const std::string &  name 
)

Update a task (dependency).

This function will update the name that this task wrapper refers to.

Parameters
wrapperThe existing apex::task_wrapper object
nameThe new name of the timer.

◆ version()

std::string& apex::version ( void  )

Return the APEX version.

Returns
A string with the APEX version.

◆ yield() [1/2]

void apex::yield ( profiler *  the_profiler)

Stop a timer, but don't increment the number of calls.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timer value will eventually added to the profile for the process. The number of calls will NOT be incremented - this "task" was yielded, not completed. It will be resumed by another thread at a later time.

Parameters
the_profilerThe handle of the profiler object.
Returns
No return value.
See also
apex::start, apex::stop, apex::resume

◆ yield() [2/2]

void apex::yield ( std::shared_ptr< task_wrapper task_wrapper_ptr)

Stop a timer, but don't increment the number of calls.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timer value will eventually added to the profile for the process. The number of calls will NOT be incremented - this "task" was yielded, not completed. It will be resumed by another thread at a later time.

Parameters
task_wrapper_ptran apex::task_wrapper pointer that was started
Returns
No return value.
See also
apex::start, apex::stop, apex::resume