High Performance Computing 1
Hello World
•#include <stdio.h>
•#include "mpi.h“
•
•main(int argc, char** argv)
•{
•int my_rank; /* Rank of process */
•int p; /* Number of processes */
•int source; /* Rank of sender */
•int dest; /* Rank of receiver */
•int tag = 50; /* Tag for messages */
•char message[100]; /* Storage for the message */
•MPI_Status status; /* Return status for receive */
•
•MPI_Init(&argc, &argv);
•MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
•MPI_Comm_size(MPI_COMM_WORLD, &p);
•