Here is my MPI_Bcast code first.
#include <iostream>
#include <mpi.h>
using namespace std;
int main(int argc, char* argv[])
{
int rank;
int data=0;
MPI_Init(&argc,&argv);
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
//means processors from 0 to 10
if (rank == 0){
data = 10;
}
printf("/nbefore bcast data in Process %d : %d" , rank, data);
MPI_Bcast(&data,1,MPI_INT, 0, MPI_COMM_WORLD);
printf("/nafter bcast data in Process %d : %d" , rank, data);
MPI_Finalize();
return 0;
}
After run, the "outcome" said: [proxy:0:0@condo038] HYDU_create_process (../../utils/launch/launch.c:825): execvp error on file ./Fan (No such file or directory).
Does anyone know what happened?
- Is the code correct?
- How to get expected outcome?