// Initialisation
MPI_Init(&argc, &argv) // initialise MPI; must be first
MPI_Finalize() // shut down MPI; must be last
MPI_Abort(comm, errorcode) // terminate all processes in comm
// Communicator queries
MPI_Comm_rank(comm, &rank) // rank of calling process in comm
MPI_Comm_size(comm, &size) // number of processes in comm
MPI_Comm_split(comm, color, key, &newcomm) // partition into sub-communicators
MPI_Comm_free(&comm) // release a communicator
// Point-to-point
MPI_Send(buf, count, type, dest, tag, comm)
MPI_Recv(buf, count, type, src, tag, comm, &status)
MPI_Sendrecv(sbuf, sc, st, dest, stag,
rbuf, rc, rt, src, rtag, comm, &status)
MPI_Isend(buf, count, type, dest, tag, comm, &req)
MPI_Irecv(buf, count, type, src, tag, comm, &req)
MPI_Wait(&req, &status)
MPI_Test(&req, &flag, &status)
MPI_Waitall(count, reqs, statuses)
// Collectives
MPI_Barrier(comm)
MPI_Bcast(buf, count, type, root, comm)
MPI_Scatter(sbuf, sc, st, rbuf, rc, rt, root, comm)
MPI_Gather(sbuf, sc, st, rbuf, rc, rt, root, comm)
MPI_Scatterv(sbuf, scounts, displs, st, rbuf, rc, rt, root, comm)
MPI_Gatherv(sbuf, sc, st, rbuf, rcounts, displs, rt, root, comm)
MPI_Allgather(sbuf, sc, st, rbuf, rc, rt, comm)
MPI_Alltoall(sbuf, sc, st, rbuf, rc, rt, comm)
MPI_Reduce(sbuf, rbuf, count, type, op, root, comm)
MPI_Allreduce(sbuf, rbuf, count, type, op, comm)
MPI_Scan(sbuf, rbuf, count, type, op, comm) // inclusive prefix reduction
// Derived datatypes
MPI_Type_contiguous(count, oldtype, &newtype)
MPI_Type_vector(count, blocklength, stride, oldtype, &newtype)
MPI_Type_create_struct(count, blocklengths, displs, types, &newtype)
MPI_Type_commit(&type)
MPI_Type_free(&type)
// One-sided
MPI_Win_create(base, size, disp_unit, info, comm, &win)
MPI_Put(obuf, oc, ot, target_rank, disp, tc, tt, win)
MPI_Get(obuf, oc, ot, target_rank, disp, tc, tt, win)
MPI_Accumulate(obuf, oc, ot, target_rank, disp, tc, tt, op, win)
MPI_Win_fence(assert, win)
MPI_Win_free(&win)
// Timing
MPI_Wtime() // wall-clock time in seconds
MPI_Wtick() // resolution of MPI_Wtime