I created a simple console program in VS 2015 using ms mpi.
#include <stdio.h>
#include <mpi.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int rank=0, size=0;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
if (rank == 0)
{
char helloStr[] = "Hello World";
}
else if (rank == 1)
{
char helloStr[12];
MPI_Recv(helloStr, _countof(helloStr), MPI_CHAR, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
printf("Rank 1 received string %s from Rank 0\n", helloStr);
}
printf("hello from proccess rank %d from size %d\n",rank,size);
MPI_Finalize();
return 0;
}
This program is compiled and executed. But if use> mpiexec -n 2 myprog.exe, I get an error: the start block could not be allocated.
source
share