Skip to content

Handle Debugging:Op queries

Joachim edited this page Mar 3, 2022 · 2 revisions

Op queries

What to solve:

typedef ompi_op_.._t * MPI_Op;
typedef int MPI_Op;
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
                         MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);

int MPI_Iallreduce(const void *sendbuf, void *recvbuf, int count,
                         MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* req);

MPI_Wait(req, ...)

Use case: stopped at MPI_Allreduce, what is op? Or: stopped at MPI_Wait, what op was used in the non-blocking reduction call?

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

int mpidbg_op_query(mqs_process *process,
                         langHandle op,  // The MPI handle
                         int language, // MPIDBG_TYPE_LANG_C or MPIDBG_TYPE_LANG_FORTRAN 
                         struct mpidbg_op_handle_t **handle,
                         enum mpidbg_op_kind_t *op_kind);


enum mpidbg_op_kind_t{
  MPIDBG_OP_KIND_USER = 1,
  MPIDBG_OP_KIND_MPI_MAX,
  MPIDBG_OP_KIND_MPI_MIN,
  MPIDBG_OP_KIND_MPI_SUM,
  MPIDBG_OP_KIND_MPI_PROD,
  MPIDBG_OP_KIND_MPI_MAXLOC,
  MPIDBG_OP_KIND_MPI_MINLOC,
  MPIDBG_OP_KIND_MPI_BAND,
  MPIDBG_OP_KIND_MPI_BOR,
  MPIDBG_OP_KIND_MPI_BXOR,
  MPIDBG_OP_KIND_MPI_LAND,
  MPIDBG_OP_KIND_MPI_LOR,
  MPIDBG_OP_KIND_MPI_LXOR,
  MPIDBG_OP_KIND_MPI_REPLACE,
  MPIDBG_OP_KIND_MPI_NO_OP
};

More information for user-defined Operations (if operation kind is MPIDBG_OP_KIND_USER):

mpidbg_op_query_userdefined(struct mpidbg_op_handle_t *handle,
                           mqs_taddr_t *user_function, /* pointer to the user-defined reduction function */
                           int64 *commutative, /* is the operation commutative */
                           int64 *language, /* MPIDBG_TYPE_LANG_C or MPIDBG_TYPE_LANG_FORTRAN */
                           mqs_taddr_t *codeptr /* indicates the source location of the MPI_Op_create call */
);

codeptr: either a valid PC or nullptr

Clone this wiki locally