#include <iostream>
#include <mpi.h>
using namespace std;
int main() {
// initialize the MPI environment
MPI_Init(NULL, NULL);
// get the number of processes
int worldSize;
MPI_Comm_size(MPI_COMM_WORLD, &worldSize);
// get the rank of the process
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
cout << "Hello world from process " << rank << " out of " << worldSize << endl;
MPI_Finalize();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bXBpLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICAvLyBpbml0aWFsaXplIHRoZSBNUEkgZW52aXJvbm1lbnQKICAgIE1QSV9Jbml0KE5VTEwsIE5VTEwpOwoKICAgIC8vIGdldCB0aGUgbnVtYmVyIG9mIHByb2Nlc3NlcwogICAgaW50IHdvcmxkU2l6ZTsKICAgIE1QSV9Db21tX3NpemUoTVBJX0NPTU1fV09STEQsICZ3b3JsZFNpemUpOwoKICAgIC8vIGdldCB0aGUgcmFuayBvZiB0aGUgcHJvY2VzcwogICAgaW50IHJhbms7CiAgICBNUElfQ29tbV9yYW5rKE1QSV9DT01NX1dPUkxELCAmcmFuayk7CgogICAgY291dCA8PCAiSGVsbG8gd29ybGQgZnJvbSBwcm9jZXNzICIgPDwgcmFuayA8PCAiIG91dCBvZiAiIDw8IHdvcmxkU2l6ZSA8PCBlbmRsOwoKICAgIE1QSV9GaW5hbGl6ZSgpOwogICAgcmV0dXJuIDA7Cn0K