Created
November 29, 2018 18:40
-
-
Save ac101m/99fad5776872e83a4c1c60aa282772b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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) { | |
MPI_Init(&argc, &argv); | |
int totalRanks, myRank, nameLen; | |
char myName[MPI_MAX_PROCESSOR_NAME]; | |
MPI_Comm_rank(MPI_COMM_WORLD, &myRank); | |
MPI_Comm_size(MPI_COMM_WORLD, &totalRanks); | |
MPI_Get_processor_name(myName, &nameLen); | |
printf("Hello world from process %d of %d, on %s\n", myRank, totalRanks, myName); | |
MPI_Finalize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment