Created
December 3, 2016 14:27
-
-
Save quaertym/d24e8ae6b5bd4697ccd7540d7509f36d to your computer and use it in GitHub Desktop.
Hello MPI
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 <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