#include #include int main(int argc, char** argv) { /* initialize MPI */ MPI_Init(&argc, &argv); /* get the rank (process id) and size (number of processes) */ int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* try to read an integer */ int number = 42; scanf("%d", &number); /* print a hello message */ printf("Process %d read %d from stdin.\n", rank, number); /* quit MPI */ MPI_Finalize(); return 0; }