root/ompi/debuggers/ompi_common_dll_defs.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2007-2014 Cisco Systems, Inc.  All rights reserved.
   4  * Copyright (c) 2004-2013 The University of Tennessee and The University
   5  *                         of Tennessee Research Foundation.  All rights
   6  *                         reserved.
   7  * Copyright (c) 2012-2013 Inria.  All rights reserved.
   8  * Copyright (c) 2015      Los Alamos National Security, LLC.  All rights
   9  *                         reserved.
  10  * Copyright (c) 2016      Research Organization for Information Science
  11  *                         and Technology (RIST). All rights reserved.
  12  * $COPYRIGHT$
  13  *
  14  * Additional copyrights may follow
  15  *
  16  * $HEADER$
  17  */
  18 
  19 /**********************************************************************
  20  * Copyright (C) 2000-2004 by Etnus, LLC.
  21  * Copyright (C) 1999 by Etnus, Inc.
  22  * Copyright (C) 1997-1998 Dolphin Interconnect Solutions Inc.
  23  *
  24  * Permission is hereby granted to use, reproduce, prepare derivative
  25  * works, and to redistribute to others.
  26  *
  27  *                                DISCLAIMER
  28  *
  29  * Neither Dolphin Interconnect Solutions, Etnus LLC, nor any of their
  30  * employees, makes any warranty express or implied, or assumes any
  31  * legal liability or responsibility for the accuracy, completeness,
  32  * or usefulness of any information, apparatus, product, or process
  33  * disclosed, or represents that its use would not infringe privately
  34  * owned rights.
  35  *
  36  * This code was written by
  37  * James Cownie: Dolphin Interconnect Solutions. <jcownie@dolphinics.com>
  38  *               Etnus LLC <jcownie@etnus.com>
  39  **********************************************************************/
  40 
  41 #ifndef OMPI_COMMON_DLL_DEFS_H
  42 #define OMPI_COMMON_DLL_DEFS_H
  43 
  44 #include "msgq_interface.h"
  45 
  46 /***********************************************************************
  47  * Information associated with a specific executable image.  Common
  48  * across all DLLs.
  49  */
  50 typedef struct
  51 {
  52     /* Functions needed here */
  53     const struct mqs_image_callbacks * image_callbacks;
  54 
  55     /* basic structures */
  56     struct {
  57         mqs_type *type;
  58         int size;
  59         struct {
  60             int opal_list_next;
  61         } offset;
  62     } opal_list_item_t;
  63     struct {
  64         mqs_type *type;
  65         int size;
  66         struct {
  67             int opal_list_sentinel;
  68         } offset;
  69     } opal_list_t;
  70     struct {
  71         mqs_type *type;
  72         int size;
  73     } opal_free_list_item_t;
  74     struct {
  75         mqs_type *type;
  76         int size;
  77         struct {
  78             int fl_frag_class;         /* opal_class_t* */
  79             int fl_mpool;              /* struct mca_mpool_base_module_t* */
  80             int fl_frag_size;          /* size_t */
  81             int fl_frag_alignment;     /* size_t */
  82             int fl_allocations;        /* opal_list_t */
  83             int fl_max_to_alloc;       /* size_t */
  84             int fl_num_per_alloc;      /* size_t */
  85             int fl_num_allocated;      /* size_t */
  86         } offset;
  87     } opal_free_list_t;
  88     struct {
  89         mqs_type *type;
  90         int size;
  91         struct {
  92             int ht_table;
  93             int ht_table_size;
  94             int ht_size;
  95             int ht_mask;
  96         } offset;
  97     } opal_hash_table_t;
  98     /* requests structures */
  99     struct {
 100         mqs_type *type;
 101         int size;
 102         struct {
 103             int req_type;
 104             int req_status;
 105             int req_complete;
 106             int req_state;
 107             int req_f_to_c_index;
 108         } offset;
 109     } ompi_request_t;
 110     struct {
 111         mqs_type *type;
 112         int size;
 113         struct {
 114             int req_addr;
 115             int req_count;
 116             int req_peer;
 117             int req_tag;
 118             int req_comm;
 119             int req_datatype;
 120             int req_proc;
 121             int req_sequence;
 122             int req_type;
 123             int req_pml_complete;
 124         } offset;
 125     } mca_pml_base_request_t;
 126     struct {
 127         mqs_type *type;
 128         int size;
 129         struct {
 130             int req_addr;
 131             int req_bytes_packed;
 132             int req_send_mode;
 133         } offset;
 134     } mca_pml_base_send_request_t;
 135     struct {
 136         mqs_type *type;
 137         int size;
 138         struct {
 139             int req_bytes_packed;
 140         } offset;
 141     } mca_pml_base_recv_request_t;
 142 #if 0
 143     /* fragments for unexpected messages (as well as theirs headers) */
 144     struct {
 145         mqs_type *type;
 146         int size;
 147         struct {
 148             int hdr;
 149             int request;
 150         } offset;
 151     } mca_pml_ob1_recv_frag_t;
 152     struct {
 153         mqs_type *type;
 154         int size;
 155         struct {
 156             int hdr_type;
 157             int hdr_flags;
 158         } offset;
 159     } mca_pml_ob1_common_hdr_t;
 160     struct {
 161         mqs_type *type;
 162         int size;
 163         struct {
 164             int hdr_common;
 165             int hdr_ctx;
 166             int hdr_src;
 167             int hdr_tag;
 168             int hdr_seq;
 169         } offset;
 170     } mca_pml_ob1_match_hdr_t;
 171 #endif
 172     /* opal_pointer_array structure */
 173     struct {
 174         mqs_type *type;
 175         int size;
 176         struct {
 177             int lowest_free;
 178             int number_free;
 179             int size;
 180             int addr;
 181         } offset;
 182     } opal_pointer_array_t;
 183     /* group structure */
 184     struct {
 185         mqs_type *type;
 186         int size;
 187         struct {
 188             int grp_proc_count;
 189             int grp_proc_pointers;
 190             int grp_my_rank;
 191             int grp_flags;
 192         } offset;
 193     } ompi_group_t;
 194     /* communicator structure */
 195     struct {
 196         mqs_type *type;
 197         int size;
 198         struct {
 199             int c_name;
 200             int c_contextid;
 201             int c_my_rank;
 202             int c_local_group;
 203             int c_remote_group;
 204             int c_flags;
 205             int c_f_to_c_index;
 206             int c_topo;
 207             int c_keyhash;
 208         } offset;
 209     } ompi_communicator_t;
 210     /* base topology information in a communicator */
 211     struct {
 212         mqs_type *type;
 213         int size;
 214         struct {
 215             int mtc;
 216             struct {
 217                 int ndims;
 218                 int dims;
 219                 int periods;
 220                 int coords;
 221             } mtc_cart;
 222             struct {
 223                 int nnodes;
 224                 int index;
 225                 int edges;
 226             } mtc_graph;
 227             struct {
 228                 int in;
 229                 int inw;
 230                 int out;
 231                 int outw;
 232                 int indegree;
 233                 int outdegree;
 234                 int weighted;
 235             } mtc_dist_graph;
 236             int reorder;
 237         } offset;
 238     } mca_topo_base_module_t;
 239     /* MPI_Status */
 240     struct {
 241         mqs_type *type;
 242         int size;
 243         struct {
 244             int MPI_SOURCE;
 245             int MPI_TAG;
 246             int MPI_ERROR;
 247             int _cancelled;
 248             size_t _ucount;
 249         } offset;
 250     } ompi_status_public_t;
 251     /* datatype structure */
 252     struct {
 253         mqs_type *type;
 254         int size;
 255         struct {
 256             int size;
 257             int name;
 258         } offset;
 259     } ompi_datatype_t;
 260 
 261     /* For the caller to hang their own stuff */
 262     void *extra;
 263 } mpi_image_info;
 264 
 265 /***********************************************************************/
 266 /* Information for a single process.  Common across all DLLs.
 267  */
 268 typedef struct
 269 {
 270     const struct mqs_process_callbacks * process_callbacks; /* Functions needed here */
 271 
 272     mqs_target_type_sizes sizes;                        /* Process architecture information */
 273 
 274     /* For the caller to hang their own stuff */
 275     void *extra;
 276 } mpi_process_info;
 277 
 278 /**********************************************************************/
 279 /* Macros to make it transparent that we're calling the TV functions
 280  * through function pointers.
 281  */
 282 #define mqs_malloc           (mqs_basic_entrypoints->mqs_malloc_fp)
 283 #define mqs_free             (mqs_basic_entrypoints->mqs_free_fp)
 284 #define mqs_prints           (mqs_basic_entrypoints->mqs_dprints_fp)
 285 #define mqs_put_image_info   (mqs_basic_entrypoints->mqs_put_image_info_fp)
 286 #define mqs_get_image_info   (mqs_basic_entrypoints->mqs_get_image_info_fp)
 287 #define mqs_put_process_info (mqs_basic_entrypoints->mqs_put_process_info_fp)
 288 #define mqs_get_process_info (mqs_basic_entrypoints->mqs_get_process_info_fp)
 289 
 290 /* These macros *RELY* on the function already having set up the conventional
 291  * local variables i_info or p_info.
 292  */
 293 #define mqs_find_type        (i_info->image_callbacks->mqs_find_type_fp)
 294 #define mqs_field_offset     (i_info->image_callbacks->mqs_field_offset_fp)
 295 #define mqs_sizeof           (i_info->image_callbacks->mqs_sizeof_fp)
 296 #define mqs_get_type_sizes   (i_info->image_callbacks->mqs_get_type_sizes_fp)
 297 #define mqs_find_function    (i_info->image_callbacks->mqs_find_function_fp)
 298 #define mqs_find_symbol      (i_info->image_callbacks->mqs_find_symbol_fp)
 299 
 300 #define mqs_get_image        (p_info->process_callbacks->mqs_get_image_fp)
 301 #define mqs_get_global_rank  (p_info->process_callbacks->mqs_get_global_rank_fp)
 302 #define mqs_fetch_data       (p_info->process_callbacks->mqs_fetch_data_fp)
 303 #define mqs_target_to_host   (p_info->process_callbacks->mqs_target_to_host_fp)
 304 
 305 /* Basic callbacks into the debugger */
 306 extern const mqs_basic_callbacks *mqs_basic_entrypoints;
 307 
 308 /* OMPI-specific functions */
 309 int ompi_fill_in_type_info(mqs_image *image, char **message);
 310 
 311 /* Fetch a pointer from the process */
 312 mqs_taddr_t ompi_fetch_pointer(mqs_process *proc, mqs_taddr_t addr,
 313                                mpi_process_info *p_info);
 314 
 315 /* Fetch an int from the process */
 316 mqs_tword_t ompi_fetch_int(mqs_process *proc, mqs_taddr_t addr,
 317                            mpi_process_info *p_info);
 318 
 319 /* Fetch a bool from the process */
 320 mqs_tword_t ompi_fetch_bool(mqs_process *proc, mqs_taddr_t addr,
 321                             mpi_process_info *p_info);
 322 
 323 /* Fetch a size_t from the process */
 324 mqs_taddr_t ompi_fetch_size_t(mqs_process *proc, mqs_taddr_t addr,
 325                               mpi_process_info *p_info);
 326 
 327 /* Helpers to fetch stuff from an opal_pointer_array_t */
 328 int ompi_fetch_opal_pointer_array_info(mqs_process *proc, mqs_taddr_t addr,
 329                                        mpi_process_info *p_info,
 330                                        int *size, int *lowest_free,
 331                                        int *number_free);
 332 int ompi_fetch_opal_pointer_array_item(mqs_process *proc, mqs_taddr_t addr,
 333                                        mpi_process_info *p_info, int index,
 334                                        mqs_taddr_t *item);
 335 #define OMPI_MAX_VER_SIZE 256
 336 int ompi_get_lib_version(char *buf, int size);
 337 #endif

/* [<][>][^][v][top][bottom][index][help] */