To receive notifications about scheduled maintenance, please subscribe to the mailing-list You can subscribe to the mailing-list at

Commit ab56a7ce authored by chatzidp's avatar chatzidp
Browse files

One more mpi example

parent a1f6d94a
#include <mpi.h>
int main(int argc, char *argv[])
int rank;
MPI_Status status;
MPI_Init(&argc, &argv); // initialize the environment
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0) {
int x = 33;
MPI_Send(&x, 1, MPI_INT, 1, 123, MPI_COMM_WORLD);
if (rank == 1) {
int y;
MPI_Recv(&y, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status);
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment