Skip to content

Instantly share code, notes, and snippets.

@quaertym
Created December 3, 2016 14:27
Show Gist options
  • Save quaertym/d24e8ae6b5bd4697ccd7540d7509f36d to your computer and use it in GitHub Desktop.
Save quaertym/d24e8ae6b5bd4697ccd7540d7509f36d to your computer and use it in GitHub Desktop.
Hello MPI
#include <mpi.h>
#include <iostream>
int main(int argc, char *argv[])
{
int rank, size;
MPI::Init(argc, argv);
rank = MPI::COMM_WORLD.Get_rank();
size = MPI::COMM_WORLD.Get_size();
std::cout<< "Hello from process "<< rank <<" of "<< size <<"\n";
MPI::Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment