Created
March 1, 2011 10:14
-
-
Save fajran/848935 to your computer and use it in GitHub Desktop.
coba.pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QT = | |
TARGET = coba | |
SOURCES += main.cpp | |
INCLUDEPATH += /usr/include/mpich2 | |
LIBS += /usr/lib/libmpich.a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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