none
How to use ms-mpi in visual studio code in windows 10 RRS feed

  • Question

  • I have read some info in Internet, and it recommend me install microsoft mpi in windows 10 so I download msmpisdk.msi and msmpisetup.exe and install msmpisetup.exe directly, the path is C:\Program Files\Microsoft MPI, but when I run a simple c program in VS, it still show "mpi.h:No such file or directory", so how to fix this problem, need I add path in classpath, if so, how? In my environment variable, it only have 

    path  C:\Program Files\Microsoft MPI\Bin\

    MSMPI_BIN C:\Program Files\Microsoft MPI\Bin\

    I don't have:

    MSMPI_INC

    MSMPI_LIB32

    MSMPI_LIB64

    could you please give some instruction? and this is my program:

    #include "stdint.h"
    #include "mpi.h"
    
    #include <stdio.h>
    #include <math.h>
    
    void main(argc,argv)
    int argc;
    char *argv[];
    {
        int myid, numprocs;
        int  namelen;
        char processor_name[MPI_MAX_PROCESSOR_NAME];
        MPI_Init(&argc,&argv);
        MPI_Comm_rank(MPI_COMM_WORLD,&myid);
        MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
        MPI_Get_processor_name(processor_name,&namelen);
        fprintf(stderr,"Hello World! Process %d of %d on %s\n",myid,numprocs,processor_name);
        MPI_Finalize();
    }

    how to complie it and run? 

    Thursday, February 20, 2020 3:41 PM

All replies

  • To compile your parallel code with msmpi, you need to install msmpisdk.msi . This will create a directory C:\Program Files (x86)\Microsoft SDKs\MPI (if other path was not specified during the installation), which will contain include and library directories.

    -thanks, Anna

    Wednesday, February 26, 2020 6:35 PM