Advertisement
patryk

[PR] 02.03.2016 - Slave.c

Mar 2nd, 2016
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 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.  
  12.     pvm_recv (-1, MSG_MSTR);
  13.     pvm_upkint (&who, 1, 1);
  14.     pvm_upkint (&iteration, 1, 1);
  15.  
  16.     pvm_initsend (PvmDataDefault);
  17.     pvm_pkint (&iteration, 1, 1);
  18.     pvm_pkstr (hostname);
  19.     pvm_send(who, MSG_SLV);
  20.  
  21.     pvm_exit();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement