Auf die installation von mpi.h für C in Ubuntu

Beginnen möchte ich mit MPI/C und ich möchte zu kompilieren/ausführen die standard-Programm, mpi_hello.
Mir ist es gelungen, über mpicc, aber ich erhalte eine Fehlermeldung, wenn ich die Datei kompilieren.
Hier ist das Programm:

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

int main (int argc, char* argv[])

{

int mynode, totalnodes;

  MPI_Init(&argc,&argv);
  MPI_Comm_size(MPI_COMM_WORLD, &totalnodes);
  MPI_Comm_rank(MPI_COMM_WORLD, &mynode);

  printf( "\nHello world from process %d of %d\n", mynode, totalnodes );
  if(totalnodes==1) printf("You have just one processor!\n");
  MPI_Finalize();
  return 0;

}

Habe ich die folgenden:

turb@turb-LIFEBOOK-AH531:~/Desktop/Prog$ mpicc mpi_hello.c
turb@turb-LIFEBOOK-AH531:~/Desktop/Prog$ cc -O3 mpi_hello.c
mpi_hello.c:6:17: fatal error: mpi.h: No such file or directory
 #include <mpi.h>
                 ^
compilation terminated.

Ich würde Ihre Hilfe schätzen. Danke!!!
ein

InformationsquelleAutor Math Student | 2014-02-27

Schreibe einen Kommentar