debuggers(调试模块)
<p><strong>debuggers</strong></p>
<p>数据类型</p>
<p><strong>数据类型执行代码</strong>
<a href="https://github.com/qianyongjun895/HPIPS/tree/master/OpenMpi-Chain/ompi/debuggers">https://github.com/qianyongjun895/HPIPS/tree/master/OpenMpi-Chain/ompi/debuggers</a></p>
<p><strong>设置数据动态库</strong>
ompi_debugger_setup_dlls(void)</p>
<p><strong> mpi_image_info预定义</strong>
typedef struct</p>
<p>{</p>
<pre><code>/*这里需要的函数*/
const struct mqs_image_callbacks * image_callbacks;
/* 基本结构 */
struct {
mqs_type *type;
int size;
struct {
int opal_list_next;
} offset;
} opal_list_item_t;
struct {
mqs_type *type;
int size;
struct {
int opal_list_sentinel;
} offset;
} opal_list_t;
struct {
mqs_type *type;
int size;
} opal_free_list_item_t;
struct {
mqs_type *type;
int size;
struct {
int fl_frag_class; /* opal_class_t* */
int fl_mpool; /* struct mca_mpool_base_module_t* */
int fl_frag_size; /* size_t */
int fl_frag_alignment; /* size_t */
int fl_allocations; /* opal_list_t */
int fl_max_to_alloc; /* size_t */
int fl_num_per_alloc; /* size_t */
int fl_num_allocated; /* size_t */
} offset;
} opal_free_list_t;
struct {
mqs_type *type;
int size;
struct {
int ht_table;
int ht_table_size;
int ht_size;
int ht_mask;
} offset;
} opal_hash_table_t;
/* 请求结构 */
struct {
mqs_type *type;
int size;
struct {
int req_type;
int req_status;
int req_complete;
int req_state;
int req_f_to_c_index;
} offset;
} ompi_request_t;
struct {
mqs_type *type;
int size;
struct {
int req_addr;
int req_count;
int req_peer;
int req_tag;
int req_comm;
int req_datatype;
int req_proc;
int req_sequence;
int req_type;
int req_pml_complete;
} offset;
} mca_pml_base_request_t;
struct {
mqs_type *type;
int size;
struct {
int req_addr;
int req_bytes_packed;
int req_send_mode;
} offset;
} mca_pml_base_send_request_t;
struct {
mqs_type *type;
int size;
struct {
int req_bytes_packed;
} offset;
} mca_pml_base_recv_request_t;
if 0
/* 意外消息的片段 (以及它们的标头) */
struct {
mqs_type *type;
int size;
struct {
int hdr;
int request;
} offset;
} mca_pml_ob1_recv_frag_t;
struct {
mqs_type *type;
int size;
struct {
int hdr_type;
int hdr_flags;
} offset;
} mca_pml_ob1_common_hdr_t;
struct {
mqs_type *type;
int size;
struct {
int hdr_common;
int hdr_ctx;
int hdr_src;
int hdr_tag;
int hdr_seq;
} offset;
} mca_pml_ob1_match_hdr_t;
endif
/* opal_pointer_array structure */
struct {
mqs_type *type;
int size;
struct {
int lowest_free;
int number_free;
int size;
int addr;
} offset;
} opal_pointer_array_t;
/* 组结构 */
struct {
mqs_type *type;
int size;
struct {
int grp_proc_count;
int grp_proc_pointers;
int grp_my_rank;
int grp_flags;
} offset;
} ompi_group_t;
/* 通信器结构 */
struct {
mqs_type *type;
int size;
struct {
int c_name;
int c_contextid;
int c_my_rank;
int c_local_group;
int c_remote_group;
int c_flags;
int c_f_to_c_index;
int c_topo;
int c_keyhash;
} offset;
} ompi_communicator_t;
/* 通信器中的基本拓扑信息 */
struct {
mqs_type *type;
int size;
struct {
int mtc;
struct {
int ndims;
int dims;
int periods;
int coords;
} mtc_cart;
struct {
int nnodes;
int index;
int edges;
} mtc_graph;
struct {
int in;
int inw;
int out;
int outw;
int indegree;
int outdegree;
int weighted;
} mtc_dist_graph;
int reorder;
} offset;
} mca_topo_base_module_t;
/* MPI_Status */
struct {
mqs_type *type;
int size;
struct {
int MPI_SOURCE;
int MPI_TAG;
int MPI_ERROR;
int _cancelled;
size_t _ucount;
} offset;
} ompi_status_public_t;
/* 数据类型结构 */
struct {
mqs_type *type;
int size;
struct {
int size;
int name;
} offset;
} ompi_datatype_t;
/* 通讯挂载需要的东西*/
void *extra;</code></pre>
<p>} mpi_image_info
<strong>注释</strong>
与特定可执行映像关联的信息。 在所有 dll 中通用</p>
<p><strong>单个进程的信息。 在所有 dll 中通用</strong>
typedef struct
{
const struct mqs_process_callbacks <em> process_callbacks; /</em>这里需要的函数 */</p>
<pre><code>mqs_target_type_sizes sizes; /* 流程体系结构信息 */
/* 通讯挂载需要的东西 */
void *extra;</code></pre>
<p>} mpi_process_info</p>
<p><strong>宏使它透明, 我们正在通过函数指针调用 TV 函数</strong>
<strong>define mqs_malloc (mqs_basic_entrypoints->mqs_malloc_fp)</strong></p>
<p><strong>define mqs_free (mqs_basic_entrypoints->mqs_free_fp)</strong></p>
<p><strong>define mqs_prints (mqs_basic_entrypoints->mqs_dprints_fp)</strong></p>
<p><strong>define mqs_put_image_info (mqs_basic_entrypoints->mqs_put_image_info_fp)</strong></p>
<p><strong>define mqs_get_image_info (mqs_basic_entrypoints->mqs_get_image_info_fp)</strong></p>
<p><strong>define mqs_put_process_info (mqs_basic_entrypoints->mqs_put_process_info_fp)</strong></p>
<p><strong>define mqs_get_process_info (mqs_basic_entrypoints->mqs_get_process_info_fp)</strong></p>
<p><strong>这些<em>RELY</em> 依赖于功能已经建立了传统的局部变量 i_info 或 p_info</strong>
<strong>define mqs_find_type (i_info->image_callbacks->mqs_find_type_fp)</strong>
<strong>define mqs_field_offset (i_info->image_callbacks->mqs_field_offset_fp)</strong>
<strong>define mqs_sizeof (i_info->image_callbacks->mqs_sizeof_fp)</strong>
<strong>define mqs_get_type_sizes (i_info->image_callbacks->mqs_get_type_sizes_fp)</strong>
<strong>define mqs_find_function (i_info->image_callbacks->mqs_find_function_fp)</strong>
<strong>define mqs_find_symbol (i_info->image_callbacks->mqs_find_symbol_fp)</strong>
<strong>define mqs_get_image (p_info->process_callbacks->mqs_get_image_fp)</strong>
<strong>define mqs_get_global_rank (p_info->process_callbacks->mqs_get_global_rank_fp)</strong>
<strong>define mqs_fetch_data (p_info->process_callbacks->mqs_fetch_data_fp)</strong>
<strong>define mqs_target_to_host (p_info->process_callbacks->mqs_target_to_host_fp)</strong>
<strong>特性函数</strong>
ompi_fill_in_type_info(mqs_image *image, char **message)</p>
<p><strong>从进程中获取指针</strong>
ompi_fetch_pointer(mqs_process <em>proc, mqs_taddr_t addr,
mpi_process_info </em>p_info)</p>
<p><strong>从进程中获取Int</strong>
ompi_fetch_int(mqs_process <em>proc, mqs_taddr_t addr,
mpi_process_info </em>p_info)</p>
<p><strong>从进程中获取bool</strong>
ompi_fetch_bool(mqs_process <em>proc, mqs_taddr_t addr,
mpi_process_info </em>p_info)</p>
<p><strong>从进程中获取尺寸</strong>
ompi_fetch_size_t(mqs_process <em>proc, mqs_taddr_t addr, mpi_process_info </em>p_info)</p>
<p><strong>获取指针数组的信息</strong>
ompi_fetch_opal_pointer_array_info(mqs_process <em>proc, mqs_taddr_t addr,
mpi_process_info </em>p_info,int <em>size, int </em>lowest_free,
int <em>number_free)
<strong>获取指针数组的数组</strong>
ompi_fetch_opal_pointer_array_item(mqs_process </em>proc, mqs_taddr_t addr,mpi_process_info <em>p_info, int index,mqs_taddr_t </em>item)</p>
<p><strong>group_t定义</strong>
typedef struct group_t</p>
<p>{</p>
<pre><code>mqs_taddr_t group_base; /* 在过程中 */
int ref_count; /* 有多少核心被使用 */
int entries; /* 总核心的统计数 */
int* local_to_global; /* 列表信息 */</code></pre>
<p>} group_t</p>
<p><strong>每个通信器保留的内部结构</strong>
typedef struct communicator_t</p>
<p>{</p>
<pre><code>struct communicator_t * next;
group_t * group; /* 列表内容 */
mqs_taddr_t comm_ptr; /* 指向进程内存中的通信器的指针 */
int present; /*验证标记 */
mqs_communicator comm_info; /* 更高层次需要的信息 */</code></pre>
<p>} communicator_t</p>
<p><strong>mqs_opal_list_t_pos</strong>
typedef struct mqs_ompi_opal_list_t_pos {</p>
<pre><code>mqs_taddr_t current_item;
mqs_taddr_t list;
mqs_taddr_t sentinel;</code></pre>
<p>} mqs_opal_list_t_pos
<strong>mqs_opal_free_list_t_pos</strong>
typedef struct {</p>
<pre><code>mqs_opal_list_t_pos opal_list_t_pos;
mqs_taddr_t current_item;
mqs_taddr_t upper_bound;
mqs_tword_t header_space;
mqs_taddr_t free_list;
mqs_tword_t fl_frag_class; /* opal_class_t* */
mqs_tword_t fl_mpool; /* struct mca_mpool_base_module_t* */
mqs_tword_t fl_frag_size; /* size_t */
mqs_tword_t fl_frag_alignment; /* size_t */
mqs_tword_t fl_num_per_alloc; /* size_t */
mqs_tword_t fl_num_allocated; /* size_t */
mqs_tword_t fl_num_initial_alloc; /* size_t */</code></pre>
<p>} mqs_opal_free_list_t_pos</p>
<p><strong>单个进程的信息、通信者列表、一些有用的地址以及迭代器的状态</strong></p>
<p><strong>mpi_process_info_extra</strong></p>
<p>typedef struct</p>
<p>{</p>
<p>struct communicator_t <em>communicator_list; /</em> 过程中的沟通者名单 */</p>
<p>/<em> 目标进程中的地址 </em>/</p>
<p>mqs_taddr_t send_queue_base; /<em> W在何处查找发送消息队列 </em>/</p>
<p>mqs_taddr_t recv_queue_base; /<em> 在何处查找接收消息队列 </em>/</p>
<p>mqs_taddr_t sendq_base; /<em> 在何处找到发送队列 </em>/</p>
<p>mqs_taddr_t commlist_base; /<em> 在哪里可以找到沟通者名单 </em>/</p>
<p>/<em> 其他信息, 我们需要记住它 </em>/</p>
<p>mqs_tword_t comm_number_free; /<em> 通信器阵列中可用位置的数目。 </em>/</p>
<p>mqs_tword_t comm_lowest_free; /<em> 最低的自由通信器 </em>/</p>
<p>mqs_tword_t show_internal_requests; /<em> 显示或不打开 MPI 内部请求 </em>/</p>
<p>/<em> 迭代器的状态 </em>/</p>
<p>struct communicator_t <em>current_communicator; /</em>简单, 我们走的是一张清单 */</p>
<p>int world_proc_array_entries;</p>
<p>mqs_taddr_t* world_proc_array;</p>
<p>mqs_opal_free_list_t_pos next_msg; /<em> And state for the message iterator </em>/</p>
<p>mqs_op_class what; /<em> 我们在看什么队列 </em>/</p>
<p>} mpi_process_info_extra;</p>