1

I am trying to install MPI on ms visual studio 2010 (our professor forced us to use 2010 version specifically probably for the privileges it offers that newer version don't idk) and it's driving me insane

I've done exactly as he told us, first I created a new c++ win32 project (yes I already have MPI and MPI SDK installed on my pc) than I edited the properties as follows:

  1. changed 'Debugging mode' to 'MPI cluster debugger'
  2. changed run environment to 'localhost/4'
  3. added '$(MSMPI_INC);%(AdditionalIncludeDirectories)' to the 'Additional include directories' in the 'C/C++' tab
  4. added '$(MSMPI_LIB32);%(AddtionalLibraryDirectories)' to the 'Additional library directories' in the 'Linker' tab
  5. added 'msmpi.lib' to the additional dependencies in the 'Input' section of he 'Linker' tab

but when I press 'Debug' four cmd windows flash and it outputs 'The batch file cannot be found' this is a code sample I am trying to run:

#include "stdafx.h"
#include <mpi.h>
#include <stdio.h>

int main(int argc, char **argv)
{
    int rank, size;
    MPI_Init(&argc, &argv);

    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
    MPI_Comm_size(MPI_COMM_WORLD, &size);
    printf("I am %d of %d\n", rank, size);

    MPI_Finalize();
    return 0;
}

what am I doing wrong ? I have a homework due tomorrow.and I already tried running visual studio as an admin
thank you for any help in advance

1 Answer 1

-1
  1. have u run (set MSMPI) on cmd to setup mpi on environment variables? if not u can include the library paths directly after installing mpi from

  2. remove #include "stdafx.h".

  3. I've tried steps from YouTube and it works for me https://www.youtube.com/watch?v=L-xJreZ55aU&t=159s

  4. if it didn't work just email me --> [email protected]

Sign up to request clarification or add additional context in comments.

1 Comment

Hello Lilian, thanks for responding, it turned out I only needed to add: 'system("pause");' before 'MPI_Finalize();' after including the iostream library

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.