SHARE
TWEET

Untitled

a guest Apr 21st, 2017 45 in 7 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <mpi.h>
  3.  
  4. int main(char argc, char **argv)
  5. {
  6.     int my_rank;
  7.     int p;
  8.     int namelength;
  9.     char processor_name[MPI_MAX_PROCESSOR_NAME];
  10.     MPI_Init(&argc, &argv);
  11.     MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
  12.     MPI_Comm_size(MPI_COMM_WORLD, &p);
  13.     MPI_Get_processor_name(processor_name, &namelength);
  14.     printf("Proces %d z %d dziala na komputerze %s\n", my_rank, p, processor_name);
  15.     MPI_Finalize();
  16.     return 0;
  17. }
RAW Paste Data
Top