none
MPI Example Error RRS feed

  • Question

  • Hello, 

    I have been trying to implement mpi example by c++ on visual studio for several hours, but every time it fails, I tried two examples I will attach a screenshot of one of them, the example is from a youtube video it succeeded in the video also I followed a tutorial to do that but it failed, please help!

    Thanks.

    I couldn't attach a screenshot so that is the code instead:

    #include "mpi.h"
    #include "stdafx.h"
    #include <string>
    #include <stdio.h>
    int main(int *argc, char **argv)
    {
     int commsize;
     int rank;
     MPI_Init(NULL, NULL);
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     MPI_Comm_size(MPI_COMM_WORLD, &commsize);
     printf("Hello MPI");
     MPI_Finalize();
     return 0;
    }

    Wednesday, May 1, 2019 6:41 PM

All replies