Lab 11
Lab 11
Algorithm
#include "stdafx.h"
#include <iostream>
#include "mpi.h"
int main(int argc, char* argv[])
{
//cout << "Hello World\n";
int nTasks, rank;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&nTasks);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
printf ("Number of threads = %d, My rank = %d\n", nTasks, rank);
int a;
std::cin>>a;
MPI_Finalize();
return 0;
}
After compiling the code, you can also run from the command line using
following command.