Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MSG_task_dsend: don't apply a default function if cleanup is NULL
[simgrid.git] / examples / smpi / get_processor_name.c
1 /* Copyright (c) 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <stdio.h>
8 #include <mpi.h>
9
10 int main(int argc, char **argv)
11 {
12   int size, rank;
13
14   char name[MPI_MAX_PROCESSOR_NAME];
15   int len;
16
17   MPI_Init(&argc, &argv);
18   MPI_Comm_size(MPI_COMM_WORLD, &size);
19   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
20
21   MPI_Get_processor_name(name, &len);
22   printf("rank %d is running on host %s\n", rank, name);
23   MPI_Finalize();
24   return 0;
25 }