patryk

[PR] 16.03.2016 slave.c

Mar 16th, 2016
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include "def.h"
  2. #include <sys/unistd.h>
  3.  
  4. main() {
  5.     int mytid;
  6.     int who, iteration;
  7.     char hostname[128];
  8.  
  9.     mytid = pvm_mytid();
  10.     gethostname(hostname, sizeof hostname);
  11.     int inst = pvm_joingroup(GROUP1);
  12.  
  13.     pvm_barrier(GROUP1, 11);
  14.  
  15.     pvm_recv (-1, MSG_MSTR);
  16.     pvm_upkint (&who, 1, 1);
  17.     pvm_upkint (&iteration, 1, 1);
  18.  
  19.     pvm_initsend (PvmDataDefault);
  20.     pvm_pkint (&inst, 1, 1);
  21.     pvm_pkstr (hostname);
  22.     pvm_send(who, MSG_SLV);
  23.  
  24.     pvm_exit();
  25. }
Add Comment
Please, Sign In to add comment