#include #include #include #include "mpi.h" int main(int argc, char** argv) { int me, nproc; char hostname[PATH_MAX]; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &me); MPI_Comm_size(MPI_COMM_WORLD, &nproc); if(gethostname(hostname, PATH_MAX) == 0){ printf("I'm clone %d out of %d total located @ %s\n", me, nproc, hostname); } else { printf("I'm a lost clone %d out of %d total!\n", me, nproc); } MPI_Finalize(); return 0; }