Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI_MAXLOC & MPI_MINLOC + all associated datatype MPI_DOUBLE_INT, MPI_FLOAT_INT,...
[simgrid.git] / examples / smpi / get_processor_name.c
1 #include <stdio.h>
2 #include <mpi.h>
3
4 int main (int argc, char **argv) {
5   int size, rank;
6
7   char name[MPI_MAX_PROCESSOR_NAME];
8   int len;
9
10   MPI_Init(&argc, &argv);
11   MPI_Comm_size(MPI_COMM_WORLD, &size);
12   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
13
14   MPI_Get_processor_name(name,&len);
15   printf("rank %d is running on host %s\n", rank, name);
16   MPI_Finalize();
17   return 0;
18 }