StarPU Handbook - StarPU Extensions
starpu_perf_monitoring.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2019-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  *
5  * StarPU is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation; either version 2.1 of the License, or (at
8  * your option) any later version.
9  *
10  * StarPU is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15  */
16 
17 #ifndef __STARPU_PERF_MONITORING_H__
18 #define __STARPU_PERF_MONITORING_H__
19 
20 #include <starpu.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
41 {
46 };
47 
52 {
58 };
59 
60 struct starpu_perf_counter_listener;
61 struct starpu_perf_counter_sample;
62 struct starpu_perf_counter_set;
63 
72 
81 
90 
106 const char *starpu_perf_counter_id_to_name(int id);
115 
124 
128 struct starpu_perf_counter_set *starpu_perf_counter_set_alloc(enum starpu_perf_counter_scope scope);
132 void starpu_perf_counter_set_free(struct starpu_perf_counter_set *set);
133 
137 void starpu_perf_counter_set_enable_id(struct starpu_perf_counter_set *set, int id);
141 void starpu_perf_counter_set_disable_id(struct starpu_perf_counter_set *set, int id);
142 
146 struct starpu_perf_counter_listener *starpu_perf_counter_listener_init(struct starpu_perf_counter_set *set, void (*callback)(struct starpu_perf_counter_listener *listener, struct starpu_perf_counter_sample *sample, void *context), void *user_arg);
150 void starpu_perf_counter_listener_exit(struct starpu_perf_counter_listener *listener);
151 
155 void starpu_perf_counter_set_global_listener(struct starpu_perf_counter_listener *listener);
159 void starpu_perf_counter_set_per_worker_listener(unsigned workerid, struct starpu_perf_counter_listener *listener);
163 void starpu_perf_counter_set_all_per_worker_listeners(struct starpu_perf_counter_listener *listener);
167 void starpu_perf_counter_set_per_codelet_listener(struct starpu_codelet *cl, struct starpu_perf_counter_listener *listener);
168 
185 
189 int32_t starpu_perf_counter_sample_get_int32_value(struct starpu_perf_counter_sample *sample, const int counter_id);
193 int64_t starpu_perf_counter_sample_get_int64_value(struct starpu_perf_counter_sample *sample, const int counter_id);
197 float starpu_perf_counter_sample_get_float_value(struct starpu_perf_counter_sample *sample, const int counter_id);
201 double starpu_perf_counter_sample_get_double_value(struct starpu_perf_counter_sample *sample, const int counter_id);
202 
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 #endif /* __STARPU_PERF_MONITORING_H__ */
Definition: starpu_task.h:317
int starpu_perf_counter_scope_name_to_id(const char *name)
const char * starpu_perf_counter_scope_id_to_name(enum starpu_perf_counter_scope scope)
int starpu_perf_counter_get_type_id(int id)
double starpu_perf_counter_sample_get_double_value(struct starpu_perf_counter_sample *sample, const int counter_id)
void starpu_perf_counter_list_all_avail(void)
void starpu_perf_counter_set_all_per_worker_listeners(struct starpu_perf_counter_listener *listener)
starpu_perf_counter_type
Definition: starpu_perf_monitoring.h:52
const char * starpu_perf_counter_get_help_string(int id)
int starpu_perf_counter_nb(enum starpu_perf_counter_scope scope)
void starpu_perf_counter_collection_stop(void)
void starpu_perf_counter_unset_global_listener(void)
void starpu_perf_counter_unset_all_per_worker_listeners(void)
void starpu_perf_counter_set_per_worker_listener(unsigned workerid, struct starpu_perf_counter_listener *listener)
void starpu_perf_counter_list_avail(enum starpu_perf_counter_scope scope)
int starpu_perf_counter_type_name_to_id(const char *name)
void starpu_perf_counter_listener_exit(struct starpu_perf_counter_listener *listener)
void starpu_perf_counter_set_per_codelet_listener(struct starpu_codelet *cl, struct starpu_perf_counter_listener *listener)
int starpu_perf_counter_nth_to_id(enum starpu_perf_counter_scope scope, int nth)
void starpu_perf_counter_set_global_listener(struct starpu_perf_counter_listener *listener)
int64_t starpu_perf_counter_sample_get_int64_value(struct starpu_perf_counter_sample *sample, const int counter_id)
void starpu_perf_counter_unset_per_codelet_listener(struct starpu_codelet *cl)
void starpu_perf_counter_set_enable_id(struct starpu_perf_counter_set *set, int id)
starpu_perf_counter_scope
Definition: starpu_perf_monitoring.h:41
float starpu_perf_counter_sample_get_float_value(struct starpu_perf_counter_sample *sample, const int counter_id)
int starpu_perf_counter_name_to_id(enum starpu_perf_counter_scope scope, const char *name)
const char * starpu_perf_counter_id_to_name(int id)
void starpu_perf_counter_collection_start(void)
void starpu_perf_counter_set_free(struct starpu_perf_counter_set *set)
struct starpu_perf_counter_set * starpu_perf_counter_set_alloc(enum starpu_perf_counter_scope scope)
void starpu_perf_counter_set_disable_id(struct starpu_perf_counter_set *set, int id)
void starpu_perf_counter_unset_per_worker_listener(unsigned workerid)
const char * starpu_perf_counter_type_id_to_name(enum starpu_perf_counter_type type)
int32_t starpu_perf_counter_sample_get_int32_value(struct starpu_perf_counter_sample *sample, const int counter_id)
struct starpu_perf_counter_listener * starpu_perf_counter_listener_init(struct starpu_perf_counter_set *set, void(*callback)(struct starpu_perf_counter_listener *listener, struct starpu_perf_counter_sample *sample, void *context), void *user_arg)
@ starpu_perf_counter_type_double
Definition: starpu_perf_monitoring.h:57
@ starpu_perf_counter_type_int32
Definition: starpu_perf_monitoring.h:54
@ starpu_perf_counter_type_undefined
Definition: starpu_perf_monitoring.h:53
@ starpu_perf_counter_type_float
Definition: starpu_perf_monitoring.h:56
@ starpu_perf_counter_type_int64
Definition: starpu_perf_monitoring.h:55
@ starpu_perf_counter_scope_per_worker
Definition: starpu_perf_monitoring.h:44
@ starpu_perf_counter_scope_per_codelet
Definition: starpu_perf_monitoring.h:45
@ starpu_perf_counter_scope_global
Definition: starpu_perf_monitoring.h:43
@ starpu_perf_counter_scope_undefined
Definition: starpu_perf_monitoring.h:42