Skip to content

Instantly share code, notes, and snippets.

@fajran
Created March 1, 2011 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fajran/848935 to your computer and use it in GitHub Desktop.
Save fajran/848935 to your computer and use it in GitHub Desktop.
coba.pro
QT =
TARGET = coba
SOURCES += main.cpp
INCLUDEPATH += /usr/include/mpich2
LIBS += /usr/lib/libmpich.a
#include <mpi.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int numberOfProcessors;
int rank;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
printf("Hello MPI\r\n");
MPI_Comm_size(MPI_COMM_WORLD,&numberOfProcessors);
printf("Number of processor = %d\r\n", numberOfProcessors);
MPI_Get_processor_name(processor_name, &namelen);
printf("Process Name = %s\r\n", processor_name);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("Proses pada %d\r\n", rank);
MPI_Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment