Skip to content

Handle Debugging:Queries

Joachim edited this page May 28, 2020 · 13 revisions

General Question:

  • should the query input be the MPI opaque handle value or a pointer to a opaque handle?
    • Is taddr_t big enought to hold an opaque handle?

Communicator queries

Query a specific MPI_Comm handle and, if found and valid, return a handle that can subsequently be queried for a variety of information about this communicator. Note that the returned handle is only valid at a specific point in time. If the MPI process advances after the handle is returned, the handle should be considered stale and should therefore be freed. This function should be invoked again to obtain a new handle.

int mpidbg_comm_query(mqs_process *process,
                      mqs_taddr_t comm,
                      struct mpidbg_comm_handle_t **handle);

Free a handle returned by the mpidbg_comm_query() function.

int mpidbg_comm_handle_free(struct mpidbg_comm_handle_t *handle);

Query a handle returned by mpidbg_comm_query() and, if found and valid, return basic information about the original communicator. All arrays returned in OUT variables are allocated by this function, but are the responsibility of the caller to be freed.

struct mpidbg_keyvalue_pair_t {
    /* String key name */
    char *key_name;
    /* String value */
    char *value;
};
int mpidbg_comm_query_basic(
                      struct mpidbg_comm_handle_t *handle,
                      char **comm_name,
                      enum mpidbg_comm_info_bitmap_t *comm_bitflags,
                      int *comm_rank,
                      int *comm_size,
                      int *comm_fortran_handle,
                      mqs_taddr_t *comm_cxx_handle,
                      struct mpidbg_keyvalue_pair_t **comm_extra_info);

Query a handle returned by mpidbg_comm_query() and, if found and valid, return information about the MPI processes in this communicator. All arrays returned in OUT variables are allocated by this function, but are the responsibility of the caller to be freed.

int mpidbg_comm_query_procs(struct mpidbg_comm_handle_t *handle,
                            int *comm_num_local_procs,
                            struct mpidbg_process_t **comm_local_procs,
                            int *comm_num_remote_procs,
                            struct mpidbg_process_t **comm_remote_procs);

Query a handle returned by mpidbg_comm_query() and, if found and valid, return information about the topology associated with the communicator (if any). It is not an error to call this function with communicators that do not have associated topologies; such communicators will still return MPIDBG_SUCCESS but simply return a value of 0 in the comm_out_length OUT parameter.

int mpidbg_comm_query_topo(struct mpidbg_comm_handle_t *handle,
                           int *comm_out_length,
                           int **comm_cart_dims_or_graph_indexes,
                           int **comm_cart_periods_or_graph_edges);

Query a handle returned by mpidbg_comm_query() and, if found and valid, return information about the attributes associated with the communicator (if any). It is not an error to call this function with communicators that do not have associated attributes; such communicators will still return MPIDBG_SUCCESS but simply return a value of 0 in the comm_attrs_length OUT parameter.

int mpidbg_comm_query_attrs(struct mpidbg_comm_handle_t *comm_handle,
                            int *comm_num_attrs,
                            struct mpidbg_attribute_pair_t *comm_attrs);

Query a handle returned by mpidbg_comm_query() and, if found and valid, return an array of pending requests on this communicator. All arrays returned in OUT variables are allocated by this function, but are the responsibility of the caller to be freed.

int mpidbg_comm_query_requests(struct mpidbg_comm_handle_t *handle,
                               int *comm_num_requests,
                               mqs_taddr_t **comm_pending_requests);

alternative:

int mpidbg_comm_query_requests(struct mpidbg_comm_handle_t *handle,
                               int *comm_num_requests,
                               struct mpidbg_request_handle_t **comm_pending_requests);

Query a handle returned by mpidbg_comm_query() and, if found and valid, return arrays of MPI_File and MPI_Win handles that were derived from this communicator.

int mpidbg_comm_query_derived(struct mpidbg_comm_handle_t *handle,
                              int *comm_num_derived_files,
                              mqs_taddr_t **comm_derived_files,
                              int *comm_num_derived_windows,
                              mqs_taddr_t **comm_derived_windows);

Request queries

What to solve:

typedef ompi_request_.._t * MPI_Request;
typedef int MPI_Request;
int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
              int tag, MPI_Comm comm, MPI_Request *request);


MPI_Request request;
MPI_Irecv(..., &request);
...
MPI_Wait(&request);

Use case: stopped at MPI_Wait, what is request?

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

int mpidbg_request_query(mqs_process *process,
                         mqs_taddr_t request,
                         struct mpidbg_request_handle_t **handle);

Free a handle returned by the mpidbg_request_query() function.

int mpidbg_request_handle_free(struct mpidbg_request_handle_t *handle);

Status queries

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

int mpidbg_status_query(mqs_process *process,
                        mqs_taddr_t status,
                        struct mpidbg_status_handle_t **handle);

Free a handle returned by the mpidbg_status_query() function.

int mpidbg_status_handle_free(struct mpidbg_status_handle_t *handle);

Type queries

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

int mpidbg_type_query(mqs_process *process,
                      mqs_taddr_t type,
                      struct mpidbg_type_handle_t **handle);

Free a handle returned by the mpidbg_type_query() function.

int mpidbg_type_handle_free(struct mpidbg_type_handle_t *handle);

File queries

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

int mpidbg_file_query(mqs_process *process,
                      mqs_taddr_t file,
                      struct mpidbg_file_handle_t **handle);

Free a handle returned by the mpidbg_file_query() function.

int mpidbg_file_handle_free(struct mpidbg_file_handle_t *handle);

Window queries

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

int mpidbg_win_query(mqs_process *process,
                     mqs_taddr_t win,
                     struct mpidbg_win_handle_t **handle);

Free a handle returned by the mpidbg_win_query() function.

int mpidbg_win_handle_free(struct mpidbg_win_handle_t *handle);

Group queries

Clone this wiki locally