Skip to content

Handle Debugging:Type queries

Joachim edited this page Apr 29, 2021 · 8 revisions

Type queries

These functions are analogous to the mpidbg_comm_* functions, but for MPI_Datatype.

typedef union langHandle {mqs_taddr_t cType, int64 fortranType} langHandle;
int mpidbg_type_query(mqs_process *process,
                      langHandle type,  // The MPI handle
                      int language, // MPIDBG_TYPE_LANG_C or MPIDBG_TYPE_LANG_FORTRAN 
                      struct mpidbg_type_handle_t **handle);  // The debugging handle

Function to query the list of predefined data types

int mpidbg_type_query_predefined_map(mqs_process *process,
                                    struct mpidbg_name_map_t **mpidbg_type_name_map,
                                    int *num_elements);

enum mpidbg_type_bitmap_t{
  MPIDBG_TYPE_KIND_INT = 0x1,
  MPIDBG_TYPE_KIND_UINT = 0x2,
  MPIDBG_TYPE_KIND_FLOAT = 0x4,
  MPIDBG_TYPE_KIND_COMPLEX = 0x8,
  MPIDBG_TYPE_KIND_NONTRIVIAL = 0x10, // use the combiner to get the structure (MPI_DOUBLE_INT)
  MPIDBG_TYPE_LANG_C = 0x100,
  MPIDBG_TYPE_LANG_FORTRAN = 0x200
};

struct mpidbg_name_map_t {
    /* Name of the handle */
    char *map_name;

    /* Handle that the name corresponds to.  Will be 0/NULL if there
       is no corresponding back-end object. */
    mqs_taddr_t type_c_handle; // allways C handle value
    int64 type_fortran_handle;
    enum mpidbg_type_kind_t kind;
};

Basic query function:

int mpidbg_type_query_basic(
                      struct mpidbg_type_handle_t *handle,
                      char **type_name,                         // or: use enum for all predefined types
                      enum mpidbg_type_info_bitmap_t *type_bitflags,
                      int64 *type_size,
                      int64 *type_extent,                       // or in a separate query
                      int64 *type_real_extent,                  // or in a separate query
                      int64 *type_fortran_handle,
                      mqs_taddr_t *type_c_handle,
                      /*mqs_taddr_t *type_cxx_handle,   was deprecated and removed*/
?                      struct mpidbg_keyvalue_pair_t **comm_extra_info);

Envelope functions:

int mpidbg_type_query_envelope(
                      struct mpidbg_type_handle_t *handle,
                      int64 *num_integers,
                      int64 *num_addresses,
                      int64 *num_datatypes);
int mpidbg_type_query_combiner(
                      struct mpidbg_type_handle_t *handle,
                      int64 max_integers,
                      int64 max_addresses,
                      int64 max_datatypes,
                      int64 array_of_integers[],
                      int64 array_of_addresses[],
                      mqs_taddr_t array_of_type_mpi_handle[], // used to lookup predefined types in the map
                      struct mpidbg_type_handle_t array_of_type_dbg_handle[] // used for further exploration);

Free a handle returned by the mpidbg_type_query() function.

int mpidbg_type_handle_free(struct mpidbg_type_handle_t *handle);
Clone this wiki locally