Skip to content

Handle Debugging:Op queries

Marc-Andre edited this page Apr 8, 2025 · 4 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 mpid_comm_* functions, but for MPI_Op.

int mpid_op_query(mpid_process_handle_t *process,
                  langHandle op,  // The MPI handle
                  int language, // mpid_TYPE_LANG_C or mpid_TYPE_LANG_FORTRAN 
                  mpid_op_handle_t **handle,
                  enum mpid_op_kind_t *op_kind);


enum mpid_op_kind_t{
  MPID_OP_KIND_USER = 1,
  MPID_OP_KIND_MPI_MAX,
  MPID_OP_KIND_MPI_MIN,
  MPID_OP_KIND_MPI_SUM,
  MPID_OP_KIND_MPI_PROD,
  MPID_OP_KIND_MPI_MAXLOC,
  MPID_OP_KIND_MPI_MINLOC,
  MPID_OP_KIND_MPI_BAND,
  MPID_OP_KIND_MPI_BOR,
  MPID_OP_KIND_MPI_BXOR,
  MPID_OP_KIND_MPI_LAND,
  MPID_OP_KIND_MPI_LOR,
  MPID_OP_KIND_MPI_LXOR,
  MPID_OP_KIND_MPI_REPLACE,
  MPID_OP_KIND_MPI_NO_OP
};

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

mpid_op_query_userdefined(mpid_op_handle_t *handle,
                          mpid_address_t *user_function, /* pointer to the user-defined reduction function */
                          int64 *commutative, /* is the operation commutative */
                          int64 *language, /* mpid_TYPE_LANG_C or mpid_TYPE_LANG_FORTRAN */
                          mpid_address_t *codeptr /* indicates the source location of the MPI_Op_create call */
);

codeptr: either a valid PC or nullptr

Clone this wiki locally