Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Created October 16, 2012 16:34
Show Gist options
  • Select an option

  • Save juanpabloaj/3900402 to your computer and use it in GitHub Desktop.

Select an option

Save juanpabloaj/3900402 to your computer and use it in GitHub Desktop.
hello mpi
#include <mpi.h>
#include <stdio.h>
int main(int argc, char *argv[]){
int nprocs, rank;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
printf("Process %d of %d\n", rank, nprocs);
MPI_Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment