4

I created simple console programm 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); /* starts MPI */
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* get current process id */
    MPI_Comm_size(MPI_COMM_WORLD, &size);
    if (rank == 0)
    {
        char helloStr[] = "Hello World";
    //  MPI_Send(helloStr, _countof(helloStr), MPI_CHAR, 1, 0, MPI_COMM_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 programm compile and execute. But if use > mpiexec -n 2 myprog.exe, I get error: unable to allocate launching block.

1 Answers1

3

Since you are using VS2015, I guess the reason is your username contains non-ASCII characters.

Try to run mpiexec in path which only contains ASCII characters.

phh
  • 31
  • 1