YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
instrument.h
Go to the documentation of this file.
1// Copyright (c) 2026 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef INSTRUMENT_H
6#define INSTRUMENT_H
7
8// YAC PUBLIC HEADER START
9
10#define YAC_INSTRUMENT_REGION_TABLE \
11 X(DIST_GRID_PAIR_NEW, "distributed grid pair generation") \
12 X(DIST_GRID_PAIR_DECOMP, "distributed grid pair decomposition") \
13 X(DIST_GRID_PAIR_REDIST, "distributed grid pair redistribution") \
14 X(DIST_GRID_PAIR_POINT_SEARCH, "distributed grid pair point search") \
15 X(DIST_GRID_PAIR_POINT_SEARCH_GC, "distributed grid pair point search " \
16 "(great circle edges)") \
17 X(DIST_GRID_PAIR_NNN_SEARCH, "distributed grid pair " \
18 "n-nearest-neighbour search") \
19 X(DIST_GRID_PAIR_BND_CIRCLE_SEARCH, "distributed grid pair " \
20 "bounding circle search") \
21 X(DIST_GRID_PAIR_DNN_SEARCH, "distributed grid pair " \
22 "distance-nearest-neighbour search") \
23 X(DIST_GRID_PAIR_CELL_SEARCH, "distributed grid pair cell search") \
24 X(DIST_GRID_PAIR_AUX_GRID, "distributed grid pair " \
25 "auxiliary grid generation") \
26 X(DIST_GRID_PAIR_RELOCATE_POINTS, "distributed grid pair " \
27 "point pair relocation") \
28 X(DIST_GRID_GLOBAL_TO_LOCAL, "distributed grid " \
29 "global to local id conversion") \
30 X(GEN_PROC_SPHERE_PART, "process sphere part generation") \
31 X(COMPUTE_TGT_FIELD, "target field computation (SpMV)") \
32 X(COMPUTE_TGT_FIELD_DIRECT, "target field computation (direct copy)") \
33 X(INTERP_SEARCH, "interpolation search (method stack)") \
34 X(INTERP_SEARCH_AVG, "interpolation search (average)") \
35 X(INTERP_SEARCH_NCC, "interpolation search (nearest corner cells)") \
36 X(INTERP_SEARCH_NNN, "interpolation search (n-nearest-neighbour)") \
37 X(INTERP_SEARCH_1NN, "interpolation search (nearest-neighbour)") \
38 X(INTERP_SEARCH_ZERO, "interpolation search (zero)") \
39 X(INTERP_SEARCH_DNN, "interpolation search " \
40 "(distance-nearest-neighbour)") \
41 X(INTERP_SEARCH_CONSERV_1ST,"interpolation search " \
42 "(1st order conservative)") \
43 X(INTERP_SEARCH_CONSERV_2ND,"interpolation search " \
44 "(2nd order conservative)") \
45 X(INTERP_SEARCH_FIXED, "interpolation search (fixed value)") \
46 X(INTERP_SEARCH_FILE, "interpolation search (user file)") \
47 X(INTERP_SEARCH_CHECK, "interpolation search (check)") \
48 X(INTERP_SEARCH_HCSBB, "interpolation search (Bernstein Bezier)") \
49 X(INTERP_SEARCH_CREEP, "interpolation search (creep)") \
50 X(INTERP_SEARCH_CALLBACK, "interpolation search (user callback)") \
51 X(INTERP_SEARCH_SPMAP, "interpolation search (source to target map)") \
52
53typedef enum {
54#define X(id, name) YAC_INSTR_##id,
56#undef X
59
72typedef void *(*yac_instrument_create_cb)(int id, void *user_data);
73
85typedef void (*yac_instrument_start_cb)(int id,
86 void *region_handle,
87 int depth,
88 void *user_data);
89
101typedef void (*yac_instrument_stop_cb)(int id,
102 void *region_handle,
103 int depth,
104 void *user_data);
105
116typedef void (*yac_instrument_destroy_cb)(int id,
117 void *region_handle,
118 void *user_data);
119
139 yac_instrument_destroy_cb destroy_cb,
140 void *user_data);
141
152
156
157// YAC PUBLIC HEADER STOP
158
159#endif // INSTRUMENT_H
yac_instrument_region_id
Definition instrument.h:53
@ YAC_INSTR_REGION_COUNT
Definition instrument.h:57
void(* yac_instrument_start_cb)(int id, void *region_handle, int depth, void *user_data)
Definition instrument.h:85
void *(* yac_instrument_create_cb)(int id, void *user_data)
Definition instrument.h:72
void(* yac_instrument_stop_cb)(int id, void *region_handle, int depth, void *user_data)
Definition instrument.h:101
void yac_instrument_set_callbacks(yac_instrument_create_cb create_cb, yac_instrument_start_cb start_cb, yac_instrument_stop_cb stop_cb, yac_instrument_destroy_cb destroy_cb, void *user_data)
Definition instrument.c:97
void yac_instrument_clear_callbacks(void)
Definition instrument.c:149
void(* yac_instrument_destroy_cb)(int id, void *region_handle, void *user_data)
Definition instrument.h:116
#define YAC_INSTRUMENT_REGION_TABLE
Definition instrument.h:10
const char * yac_instrument_region_name(yac_instrument_region_id id)
Definition instrument.c:154
void * user_data
int id
Definition toy_scrip.c:115