CPM: A software tool for Communication Performance Modelling

Generic model-based collectives

Functions

int CPM_Scatterv_sorted_flat (CPM_predictor *predictor, MPIB_sort_order order, void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gatherv_sorted_flat (CPM_predictor *predictor, MPIB_sort_order order, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Bcast_dfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
int CPM_Bcast_bfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
int CPM_Reduce_dfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
int CPM_Reduce_bfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
int CPM_Bcast_ucs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
int CPM_Reduce_ucs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
int CPM_Scatter_ucs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gather_ucs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Scatter_bfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Scatter_dfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gather_bfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gather_dfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Scatterv_dfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Scatterv_bfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Scatterv_ucs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gatherv_dfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gatherv_bfs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gatherv_ucs_binomial (CPM_predictor *predictor, CPM_next_node_strategy next_node, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Scatterv_Traff (CPM_predictor *predictor, void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
int CPM_Gatherv_Traff (CPM_predictor *predictor, void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm)

Detailed Description

There are two typical examples of generic implementations: switch between algorithms and processor mapping.

  • Switch between algorithms is an implementation that uses the prediction of the execution time of different algorithms of the collective operation, finds the fastest algorithm for given message size and number of processors, and switches between them. The prediction can be provided by any model. Different algorithms of the collective operations are communication primitives. .
  • Processor mapping is an implementation of a tree-based algorithm of the collective operation that maps the processors to the nodes of the communication tree in accordance with the performance of the point-to-point communications. In this case, the point-to-point communication operation is a communication primitive, which execution time can be predicted by any model. .

The interface of a generic collective operation Y based on the prediction of the communication primitive Z consists of:

  • a general, model-independent, implementation of collective operation:
    int CPM_Y(CPM_predictor* predictor, standard args) {
        if (condition with predictor->predict_Z(predictor, args))
            return ...;
    }
    
    which includes an extra parameter, a model-based predictor predictor, and calls its function predict_Z to predict the execution time of the communication primitive. For example, CPM_Scatter_bfs_binomial is a generic binomial scatter based on the point-to-point predictions CPM_predictor::predict_p2p.
  • particular model-based implementations (X stands for the name of the model):
    int X_Y(standard args) {
        return CPM_Y(&X_model_instance->predictor, standard args);
    }
    
    For example, Hockney_Scatter_bfs_binomial_min is a derivative of the generic algorithm CPM_Scatter_bfs_binomial that is based on the Hockney prediction of the point-to-point execution time.

This approach provides flexibility by reusing the same (general) implementations of a collective operation with different communication performance models.

A design of the generic collectives:

cpm_collectives.dot

Generic model-based functions are designed for use in both C/C++.


Function Documentation

int CPM_Scatterv_sorted_flat ( CPM_predictor predictor,
MPIB_sort_order  order,
void *  sendbuf,
int *  sendcounts,
int *  displs,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic sorted flat-tree scatterv. Starts from the end/beginning (order = DESC/ASC) of the sorted list.

int CPM_Gatherv_sorted_flat ( CPM_predictor predictor,
MPIB_sort_order  order,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int *  recvcounts,
int *  displs,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic sorted flat-tree gatherv. Starts from the beginning/end (order = DESC/ASC) of the sorted list.

int CPM_Bcast_dfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  buffer,
int  count,
MPI_Datatype  datatype,
int  root,
MPI_Comm  comm 
)

Generic DFS binomial bcast.

int CPM_Bcast_bfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  buffer,
int  count,
MPI_Datatype  datatype,
int  root,
MPI_Comm  comm 
)

Generic BFS binomial bcast.

int CPM_Reduce_dfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
void *  recvbuf,
int  count,
MPI_Datatype  datatype,
MPI_Op  op,
int  root,
MPI_Comm  comm 
)

Generic DFS binomial reduce.

int CPM_Reduce_bfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
void *  recvbuf,
int  count,
MPI_Datatype  datatype,
MPI_Op  op,
int  root,
MPI_Comm  comm 
)

Generic BFS binomial reduce.

int CPM_Bcast_ucs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  buffer,
int  count,
MPI_Datatype  datatype,
int  root,
MPI_Comm  comm 
)

Generic UCS binomial bcast.

int CPM_Reduce_ucs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
void *  recvbuf,
int  count,
MPI_Datatype  datatype,
MPI_Op  op,
int  root,
MPI_Comm  comm 
)

Generic UCS binomial reduce.

int CPM_Scatter_ucs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic UCS binomial scatter.

int CPM_Gather_ucs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic UCS binomial gather.

int CPM_Scatter_bfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic BFS binomial scatter.

int CPM_Scatter_dfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic DFS binomial scatter.

int CPM_Gather_bfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic BFS binomial gather.

int CPM_Gather_dfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic DFS binomial gather.

int CPM_Scatterv_dfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int *  sendcounts,
int *  displs,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic DFS binomial scatterv.

int CPM_Scatterv_bfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int *  sendcounts,
int *  displs,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic BFS binomial scatterv.

int CPM_Scatterv_ucs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int *  sendcounts,
int *  displs,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic UCS binomial scatterv.

int CPM_Gatherv_dfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int *  recvcounts,
int *  displs,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic DFS binomial gatherv.

int CPM_Gatherv_bfs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int *  recvcounts,
int *  displs,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic BFS binomial gatherv.

int CPM_Gatherv_ucs_binomial ( CPM_predictor predictor,
CPM_next_node_strategy  next_node,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int *  recvcounts,
int *  displs,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic UCS binomial gatherv.

int CPM_Scatterv_Traff ( CPM_predictor predictor,
void *  sendbuf,
int *  sendcounts,
int *  displs,
MPI_Datatype  sendtype,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic Traff scatterv.

int CPM_Gatherv_Traff ( CPM_predictor predictor,
void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
void *  recvbuf,
int *  recvcounts,
int *  displs,
MPI_Datatype  recvtype,
int  root,
MPI_Comm  comm 
)

Generic Traff gatherv.