Compiling MPI code with MS-MPI sdk in VS2010

Viewed 70

After install HPC pack 2012 and configure the HPC pack 2012 microsoft visual studio with the MPI package, now I'm trying to compile this code

#include <mpi.h>
#include <stdio.h>
using namespace std;
int main( )
{
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int NP;
MPI_Comm_size(MPI_COMM_WORLD, &NP);
// Get the rank of the process “ID”
int id;
MPI_Comm_rank(MPI_COMM_WORLD, &id);
// Print off a hello world message
printf("Hello world from processor %d \n", id);
// Finalize the MPI environment.
MPI_Finalize();
}

but I have this errors

2 error C2059: syntax error:')'                                                
5 error C2059: syntax error :')'        
1 error C2061: syntax error : identifier '_Out_writes_' 
4 error C2061: syntax error : identifier '_Out_writes_'     
3 error C2143: syntax error : missing ')' before ';'    
6 error C2143: syntax error : missing ')' before ';'    
9 IntelliSense: expected a ')'                                  
12 IntelliSense: expected a ')'                                     
8 IntelliSense: identifier "command" is undefined   
11 IntelliSense: identifier "command" is undefined     
7 IntelliSense: type name is not allowed     
10 IntelliSense: type name is not allowed   
0 Answers
Related