SummaryAll OMPD library interactions with the OpenMP program must be through a set of callbacks that
the tool provides. These callbacks must also be used for allocating or releasing resources, such as memory,
that the library needs.
DescriptionThe set of callbacks that the OMPD library must use is collected in the ompd_callbacks_t
record structure. An instance of this type is passed to the OMPD library as a parameter to ompd_initialize
(see Section 5.5.1.1 on page 1544). Each field points to a function that the OMPD library must use to
interact with the OpenMP program or for memory operations.
The alloc_memory and free_memory fields are pointers to functions the OMPD library uses to allocate and
to release dynamic memory.
print_string points to a function that prints a string.
The architectures or programming models of the OMPD library and third party tool may be different from
that of the OpenMP program that is being examined. sizeof_type points to function that allows the OMPD
library to determine the sizes of the basic integer and pointer types that the OpenMP program uses. Because
of the differences in architecture or programming model, the conventions for representing data in the OMPD
library and the OpenMP program may be different. The device_to_host field points to a function that
translates data from the conventions that the OpenMP program uses to those that the tool and OMPD
library use. The reverse operation is performed by the function to which the host_to_device field
points.
The symbol_addr_lookup field points to a callback that the OMPD library can use to find the address of a
global or thread local storage symbol. The read_memory, read_string, and write_memory fields are pointers
to functions for reading from and writing to global memory or thread local storage in the OpenMP
program.
The get_thread_context_for_thread_id field is a pointer to a function that the OMPD library can use to
obtain a thread context that corresponds to a native thread identifier.
Cross References
ompd_callback_memory_alloc_fn_t,
see
Section 5.4.1.1
on
page 1513.
ompd_callback_memory_free_fn_t,
see
Section 5.4.1.2
on
page 1515.
ompd_callback_get_thread_context_for_thread_id_fn_t,
see
Section 5.4.2.1
on
page 1518.
ompd_callback_sizeof_fn_t,
see
Section 5.4.2.2
on
page 1521.
ompd_callback_symbol_addr_fn_t,
see
Section 5.4.3.1
on
page 1524.
ompd_callback_memory_read_fn_t,
see
Section 5.4.3.2
on
page 1527.
ompd_callback_memory_write_fn_t,
see
Section 5.4.3.3
on
page 1531.
ompd_callback_device_host_fn_t,
see
Section 5.4.4
on
page 1534.
ompd_callback_print_string_fn_t,
see
Section 5.4.5
on
page 1537