Skip to content

Instantly share code, notes, and snippets.

@Gateswong
Last active August 29, 2015 14:00
Show Gist options
  • Save Gateswong/7df64e7df9ec3f2e7bc9 to your computer and use it in GitHub Desktop.
Save Gateswong/7df64e7df9ec3f2e7bc9 to your computer and use it in GitHub Desktop.
// ### Send and Receive
int MPI_Send(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm);
int MPI_Recv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Status *status);
// ### Size and Rank
int MPI_Comm_size(MPI_Comm comm, int *size);
int MPI_Comm_rank(MPI_Comm comm, int *rank);
// usage:
int myrank, nproc;
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment