| 12345678910111213141516171819202122 |
- #include <stdio.h>
- #include <mpi.h>
- int main(int argc, char **argv)
- {
- // Init MPI
- MPI_Init(&argc, &argv);
- char hostname[257];
- gethostname(hostname, 256);
- int rank, size;
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- MPI_Comm_size(MPI_COMM_WORLD, &size);
- printf("%s %d %d %d\n", hostname, getpid(), rank, size);
- MPI_Finalize();
- return 0;
- }
|