/* * Compilation examples * * ranger: mpicc -g -o hello_world hello_world.c * athena | kraken: cc -g -o hello_world hello_world.c * bluefire: mpcc_r -g -o hello_world hello_world.c * pople: icc -g -o mympi hello_world.c -lmpi * * generic linux: mpicc -g -o hello_world hello_world.c */ #include #include #include #include int main(int argc, char *argv[]) { int rank, size; char hostname[255]; pid_t myprocessid; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); myprocessid=getpid(); gethostname(hostname,sizeof(hostname)); printf( "process %d of %d pid=%d on %s\n", rank, size, myprocessid, hostname ); MPI_Finalize(); return 0; }