Skip to content

Instantly share code, notes, and snippets.

@astrcomp
Created October 15, 2016 10:49
Show Gist options
  • Save astrcomp/584bd32e6adabdbadb403359fbf72268 to your computer and use it in GitHub Desktop.
Save astrcomp/584bd32e6adabdbadb403359fbf72268 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <mpi.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int rank=0, size=0;
MPI_Init(&argc, &argv); /* starts MPI */
MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* get current process id */
MPI_Comm_size(MPI_COMM_WORLD, &size);
printf("hello from proccess rank %d from size %d\n",rank,size);
MPI_Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment