StarPU Handbook

Data Structures | Macros | Functions
Profiling

## Data Structures
struct | starpu_profiling_task_info
struct | starpu_profiling_worker_info
struct | starpu_profiling_bus_info

## Macros
#define | STARPU_PROFILING_DISABLE
#define | STARPU_PROFILING_ENABLE
#define | STARPU_NS_PER_S
#define | starpu_timespec_cmp(a, b, CMP)

## Functions
void | starpu_profiling_init (void)
void | starpu_profiling_set_id (int new_id)
int | starpu_profiling_status_set (int status)
int | starpu_profiling_status_get (void)
int | starpu_profiling_worker_get_info (int workerid, struct starpu_profiling_worker_info *worker_info)
int | starpu_bus_get_count (void)
int | starpu_bus_get_id (int src, int dst)
int | starpu_bus_get_src (int busid)
int | starpu_bus_get_dst (int busid)
void | starpu_bus_set_direct (int busid, int direct)
int | starpu_bus_get_direct (int busid)
void | starpu_bus_set_ngpus (int busid, int ngpus)
int | starpu_bus_get_ngpus (int busid)
int | starpu_bus_get_profiling_info (int busid, struct starpu_profiling_bus_info *bus_info)
static __starpu_inline void | starpu_timespec_clear (struct timespec *tsp)
static __starpu_inline void | starpu_timespec_add (struct timespec *a, struct timespec *b, struct timespec *result)
static __starpu_inline void | starpu_timespec_accumulate (struct timespec *result, struct timespec *a)
static __starpu_inline void | starpu_timespec_sub (const struct timespec *a, const struct timespec *b, struct timespec *result)
double | starpu_timing_timespec_delay_us (struct timespec *start, struct timespec *end)
double | starpu_timing_timespec_to_us (struct timespec *ts)
void | starpu_profiling_bus_helper_display_summary (void)
void | starpu_profiling_worker_helper_display_summary (void)
void | starpu_data_display_memory_stats ()

## Detailed Description

## Data Structure Documentation

## ◆ starpu_profiling_task_info

struct starpu_profiling_task_info

Information about the execution of a task. It is accessible from the field starpu_task::profiling_info if profiling was enabled.

Data Fields
struct timespec | submit_time | Date of task submission (relative to the initialization of StarPU).
struct timespec | push_start_time | Time when the task was submitted to the scheduler.
struct timespec | push_end_time | Time when the scheduler finished with the task submission.
struct timespec | pop_start_time | Time when the scheduler started to be requested for a task, and eventually gave that task.
struct timespec | pop_end_time | Time when the scheduler finished providing the task for execution.
struct timespec | acquire_data_start_time | Time when the worker started fetching input data.
struct timespec | acquire_data_end_time | Time when the worker finished fetching input data.
struct timespec | start_time | Date of task execution beginning (relative to the initialization of StarPU).
struct timespec | end_time | Date of task execution termination (relative to the initialization of StarPU).
struct timespec | release_data_start_time | Time when the worker started releasing data.
struct timespec | release_data_end_time | Time when the worker finished releasing data.
struct timespec | callback_start_time | Time when the worker started the application callback for the task.
struct timespec | callback_end_time | Time when the worker finished the application callback for the task.
int | workerid | Identifier of the worker which has executed the task.
uint64_t | used_cycles | Number of cycles used by the task, only available in the MoviSim
uint64_t | stall_cycles | Number of cycles stalled within the task, only available in the MoviSim
double | energy_consumed | Energy consumed by the task, in Joules

## ◆ starpu_profiling_worker_info

struct starpu_profiling_worker_info

Profiling information associated to a worker. The timing is provided since the previous call to starpu_profiling_worker_get_info()

Data Fields
struct timespec | start_time | Starting date for the reported profiling measurements.
struct timespec | total_time | Duration of the profiling measurement interval.
struct timespec | executing_time | Time spent by the worker to execute tasks during the profiling measurement interval.
struct timespec | sleeping_time | Time spent idling by the worker during the profiling measurement interval.
int | executed_tasks | Number of tasks executed by the worker during the profiling measurement interval.
uint64_t | used_cycles | Number of cycles used by the worker, only available in the MoviSim
uint64_t | stall_cycles | Number of cycles stalled within the worker, only available in the MoviSim
double | energy_consumed | Energy consumed by the worker, in Joules
double | flops |

## ◆ starpu_profiling_bus_info

struct starpu_profiling_bus_info

Data Fields
struct timespec | start_time | Time of bus profiling startup.
struct timespec | total_time | Total time of bus profiling.
int long long | transferred_bytes | Number of bytes transferred during profiling.
int | transfer_count | Number of transfers during profiling.

## Macro Definition Documentation

## ◆ STARPU_PROFILING_DISABLE

#define STARPU_PROFILING_DISABLE

Used when calling the function starpu_profiling_status_set() to disable profiling.

## ◆ STARPU_PROFILING_ENABLE

#define STARPU_PROFILING_ENABLE

Used when calling the function starpu_profiling_status_set() to enable profiling.

## Function Documentation

## ◆ starpu_profiling_init()

void starpu_profiling_init | ( | void |  | ) |

Reset performance counters and enable profiling if the environment variable STARPU_PROFILING is set to a positive value.

## ◆ starpu_profiling_set_id()

void starpu_profiling_set_id | ( | int | new_id | ) |

Set the ID used for profiling trace filename. Has to be called before starpu_init().

## ◆ starpu_profiling_status_set()

int starpu_profiling_status_set | ( | int | status | ) |

Set the profiling status. Profiling is activated by passing STARPU_PROFILING_ENABLE in `status`. Passing STARPU_PROFILING_DISABLE disables profiling. Calling this function resets all profiling measurements. When profiling is enabled, the field starpu_task::profiling_info points to a valid structure starpu_profiling_task_info containing information about the execution of the task. Negative return values indicate an error, otherwise the previous status is returned.

## ◆ starpu_profiling_status_get()

int starpu_profiling_status_get | ( | void |  | ) |

Return the current profiling status or a negative value in case there was an error.

## ◆ starpu_profiling_worker_get_info()

int starpu_profiling_worker_get_info | ( | int | workerid,
|  | struct starpu_profiling_worker_info * | worker_info
| ) |  |

Get the profiling info associated to the worker identified by `workerid`, and reset the profiling measurements. If the argument `worker_info` is `NULL`, only reset the counters associated to worker `workerid`. Upon successful completion, this function returns 0. Otherwise, a negative value is returned.

## ◆ starpu_bus_get_count()

int starpu_bus_get_count | ( | void |  | ) |

Return the number of buses in the machine

## ◆ starpu_bus_get_id()

int starpu_bus_get_id | ( | int | src,
|  | int | dst
| ) |  |

Return the identifier of the bus between `src` and `dst`

## ◆ starpu_bus_get_src()

int starpu_bus_get_src | ( | int | busid | ) |

Return the source point of bus `busid`

## ◆ starpu_bus_get_dst()

int starpu_bus_get_dst | ( | int | busid | ) |

Return the destination point of bus `busid`

## ◆ starpu_bus_get_profiling_info()

int starpu_bus_get_profiling_info | ( | int | busid,
|  | struct starpu_profiling_bus_info * | bus_info
| ) |  |

See _starpu_profiling_bus_helper_display_summary in src/profiling/profiling_helpers.c for a usage example. Note that calling starpu_bus_get_profiling_info() resets the counters to zero.

## ◆ starpu_timing_timespec_delay_us()

double starpu_timing_timespec_delay_us | ( | struct timespec * | start,
|  | struct timespec * | end
| ) |  |

Return the time elapsed between `start` and `end` in microseconds.

## ◆ starpu_timing_timespec_to_us()

double starpu_timing_timespec_to_us | ( | struct timespec * | ts | ) |

Convert the given timespec `ts` into microseconds

## ◆ starpu_profiling_bus_helper_display_summary()

void starpu_profiling_bus_helper_display_summary | ( | void |  | ) |

Display statistics about the bus on `stderr`. if the environment variable STARPU_BUS_STATS is defined. The function is called automatically by starpu_shutdown().

## ◆ starpu_profiling_worker_helper_display_summary()

void starpu_profiling_worker_helper_display_summary | ( | void |  | ) |

Display statistic about the workers on `stderr` if the environment variable STARPU_WORKER_STATS is defined. The function is called automatically by starpu_shutdown().

## ◆ starpu_data_display_memory_stats()

void starpu_data_display_memory_stats | ( |  | ) |

Display statistics about the current data handles registered within StarPU. StarPU must have been configured with the configure option --enable-memory-stats (see Memory Feedback).