Skip to content

Instantly share code, notes, and snippets.

@afrachioni
Last active August 29, 2015 14:14
Show Gist options
  • Save afrachioni/4fe74b21d7e475fb1151 to your computer and use it in GitHub Desktop.
Save afrachioni/4fe74b21d7e475fb1151 to your computer and use it in GitHub Desktop.
Simple MPI program which prints rank from each process.
#include<stdio.h>
#include<mpi.h>
int main (char **args, int nargs) {
MPI_Init (&nargs, &args);
int rank;
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
fprintf (stdout, "Greetings from process of rank %d.\n", rank);
MPI_Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment