#include <Python.h>
#include <omp-tools.h>
#include <dlfcn.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void *ompd_library;
#define OMPD_WEAK_ATTR …
struct _ompd_aspace_cont { … };
struct _ompd_thread_cont { … };
ompd_address_space_context_t acontext = …;
PyObject *pModule;
ompd_rc_t _print(const char *str, int category);
OMPD_WEAK_ATTR ompd_rc_t ompd_get_api_version(ompd_word_t *addr) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_version_string(const char **string) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_finalize(void) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_process_initialize(ompd_address_space_context_t *context,
ompd_address_space_handle_t **handle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_omp_version(
ompd_address_space_handle_t *address_space, ompd_word_t *omp_version) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_omp_version_string(
ompd_address_space_handle_t *address_space, const char **string) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_thread_handle(
ompd_address_space_handle_t *handle, ompd_thread_id_t kind,
ompd_size_t tidSize, const void *tid, ompd_thread_handle_t **threadHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_thread_in_parallel(
ompd_parallel_handle_t *parallelHandle, int threadNum,
ompd_thread_handle_t **threadHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_thread_handle_compare(
ompd_thread_handle_t *thread_handle1, ompd_thread_handle_t *thread_handle2,
int *cmp_value) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_get_curr_parallel_handle(ompd_thread_handle_t *threadHandle,
ompd_parallel_handle_t **parallelHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_parallel_handle_compare(
ompd_parallel_handle_t *parallel_handle_1,
ompd_parallel_handle_t *parallel_handle_2, int *cmp_value) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_get_enclosing_parallel_handle(ompd_parallel_handle_t *parallelHandle,
ompd_parallel_handle_t **enclosing) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_get_task_parallel_handle(ompd_task_handle_t *taskHandle,
ompd_parallel_handle_t **taskParallelHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_curr_task_handle(
ompd_thread_handle_t *threadHandle, ompd_task_handle_t **taskHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_generating_task_handle(
ompd_task_handle_t *taskHandle, ompd_task_handle_t **generating) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_scheduling_task_handle(
ompd_task_handle_t *taskHandle, ompd_task_handle_t **scheduling) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_get_task_in_parallel(ompd_parallel_handle_t *parallelHandle, int threadNum,
ompd_task_handle_t **taskHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_task_frame(ompd_task_handle_t *taskHandle,
ompd_frame_info_t *exitFrame,
ompd_frame_info_t *enterFrame) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_icv_from_scope(void *handle,
ompd_scope_t scope,
ompd_icv_id_t icvId,
ompd_word_t *icvValue) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_enumerate_icvs(ompd_address_space_handle_t *handle, ompd_icv_id_t current,
ompd_icv_id_t *next, const char **nextIcvName,
ompd_scope_t *nextScope, int *more) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_enumerate_states(ompd_address_space_handle_t *addrSpaceHandle,
ompd_word_t currentState, ompd_word_t *nextState,
const char **nextStateName, ompd_word_t *moreEnums) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_state(ompd_thread_handle_t *threadHandle,
ompd_word_t *state,
ompd_wait_id_t *waitId) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_task_function(ompd_task_handle_t *taskHandle,
ompd_address_t *entryPoint) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_thread_id(ompd_thread_handle_t *threadHandle,
ompd_thread_id_t kind,
ompd_size_t tidSize, void *tid) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_get_tool_data(void *handle, ompd_scope_t scope,
ompd_word_t *value,
ompd_address_t *ptr) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_get_icv_string_from_scope(void *handle, ompd_scope_t scope,
ompd_icv_id_t icvId, const char **icvString) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_rel_thread_handle(ompd_thread_handle_t *threadHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_rel_parallel_handle(ompd_parallel_handle_t *parallelHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t ompd_rel_task_handle(ompd_task_handle_t *taskHandle) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_task_handle_compare(ompd_task_handle_t *task_handle_1,
ompd_task_handle_t *task_handle_2, int *cmp_value) { … }
OMPD_WEAK_ATTR ompd_rc_t
ompd_get_display_control_vars(ompd_address_space_handle_t *address_space_handle,
const char *const **control_vars) { … }
static PyObject *ompd_open(PyObject *self, PyObject *args) { … }
ompd_rc_t _print(const char *str, int category) { … }
void _printf(const char *format, ...) { … }
static void call_ompd_rel_thread_handle_temp(PyObject *capsule) { … }
static void destroyThreadCapsule(PyObject *capsule) { … }
static void (*my_thread_capsule_destructor)(PyObject *) = …;
static void call_ompd_rel_parallel_handle_temp(PyObject *capsule) { … }
static void destroyParallelCapsule(PyObject *capsule) { … }
static void (*my_parallel_capsule_destructor)(PyObject *) = …;
static void call_ompd_rel_task_handle_temp(PyObject *capsule) { … }
static void destroyTaskCapsule(PyObject *capsule) { … }
static void (*my_task_capsule_destructor)(PyObject *) = …;
static PyObject *call_ompd_rel_thread_handle(PyObject *self, PyObject *args) { … }
ompd_rc_t _alloc(ompd_size_t bytes, void **ptr) { … }
ompd_rc_t _free(void *ptr) { … }
ompd_rc_t _sizes(ompd_address_space_context_t *_acontext,
ompd_device_type_sizes_t *sizes)
{ … }
ompd_rc_t _sym_addr(ompd_address_space_context_t *context,
ompd_thread_context_t *tcontext,
const char *symbol_name,
ompd_address_t *symbol_addr,
const char *file_name)
{ … }
ompd_rc_t _read(ompd_address_space_context_t *context,
ompd_thread_context_t *tcontext,
const ompd_address_t *addr,
ompd_size_t nbytes,
void *buffer)
{ … }
ompd_rc_t _read_string(ompd_address_space_context_t *context,
ompd_thread_context_t *tcontext,
const ompd_address_t *addr,
ompd_size_t nbytes,
void *buffer)
{ … }
ompd_rc_t
_endianess(ompd_address_space_context_t *address_space_context,
const void *input,
ompd_size_t unit_size,
ompd_size_t count,
void *output) { … }
ompd_thread_context_t *get_thread_context(int id) { … }
ompd_rc_t
_thread_context(ompd_address_space_context_t *context,
ompd_thread_id_t kind,
ompd_size_t sizeof_thread_id,
const void *thread_id,
ompd_thread_context_t **thread_context)
{ … }
static PyObject *call_ompd_initialize(PyObject *self, PyObject *noargs) { … }
static PyObject *get_thread_handle(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_thread_in_parallel(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_get_curr_parallel_handle(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_get_enclosing_parallel_handle(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_get_task_parallel_handle(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_rel_parallel_handle(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_curr_task_handle(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_get_generating_task_handle(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_get_scheduling_task_handle(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_get_task_in_parallel(PyObject *self,
PyObject *args) { … }
static PyObject *call_ompd_rel_task_handle(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_task_frame(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_icv_from_scope(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_enumerate_icvs(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_enumerate_states(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_state(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_task_function(PyObject *self, PyObject *args) { … }
static PyObject *print_capsule(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_thread_id(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_tool_data(PyObject *self, PyObject *args) { … }
static PyObject *call_ompd_get_icv_string_from_scope(PyObject *self,
PyObject *args) { … }
PyObject *test_ompd_get_thread_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_curr_parallel_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_thread_in_parallel(PyObject *self, PyObject *args);
PyObject *test_ompd_thread_handle_compare(PyObject *self, PyObject *args);
PyObject *test_ompd_get_thread_id(PyObject *self, PyObject *args);
PyObject *test_ompd_rel_thread_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_enclosing_parallel_handle(PyObject *self,
PyObject *args);
PyObject *test_ompd_parallel_handle_compare(PyObject *self, PyObject *args);
PyObject *test_ompd_rel_parallel_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_initialize(PyObject *self, PyObject *noargs);
PyObject *test_ompd_get_api_version(PyObject *self, PyObject *noargs);
PyObject *test_ompd_get_version_string(PyObject *self, PyObject *noargs);
PyObject *test_ompd_finalize(PyObject *self, PyObject *noargs);
PyObject *test_ompd_process_initialize(PyObject *self, PyObject *noargs);
PyObject *test_ompd_device_initialize(PyObject *self, PyObject *noargs);
PyObject *test_ompd_rel_address_space_handle(PyObject *self, PyObject *noargs);
PyObject *test_ompd_get_omp_version(PyObject *self, PyObject *args);
PyObject *test_ompd_get_omp_version_string(PyObject *self, PyObject *args);
PyObject *test_ompd_get_curr_task_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_task_parallel_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_generating_task_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_scheduling_task_handle(PyObject *self, PyObject *args);
PyObject *test_ompd_get_task_in_parallel(PyObject *self, PyObject *args);
PyObject *test_ompd_rel_task_handle(PyObject *self, PyObject *noargs);
PyObject *test_ompd_task_handle_compare(PyObject *self, PyObject *args);
PyObject *test_ompd_get_task_function(PyObject *self, PyObject *args);
PyObject *test_ompd_get_task_frame(PyObject *self, PyObject *args);
PyObject *test_ompd_get_state(PyObject *self, PyObject *args);
PyObject *test_ompd_get_display_control_vars(PyObject *self, PyObject *args);
PyObject *test_ompd_rel_display_control_vars(PyObject *self, PyObject *noargs);
PyObject *test_ompd_enumerate_icvs(PyObject *self, PyObject *noargs);
PyObject *test_ompd_get_icv_from_scope_with_addr_handle(PyObject *self,
PyObject *noargs);
PyObject *test_ompd_get_icv_from_scope_with_thread_handle(PyObject *self,
PyObject *noargs);
PyObject *test_ompd_get_icv_from_scope_with_parallel_handle(PyObject *self,
PyObject *noargs);
PyObject *test_ompd_get_icv_from_scope_with_task_handle(PyObject *self,
PyObject *noargs);
PyObject *test_ompd_get_icv_string_from_scope(PyObject *self, PyObject *noargs);
PyObject *test_ompd_get_tool_data(PyObject *self, PyObject *noargs);
PyObject *test_ompd_enumerate_states(PyObject *self, PyObject *noargs);
static PyMethodDef ompdModule_methods[] = …;
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = …;
#endif
void PyInit_ompdModule(void) { … }