Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "def.h"
- main()
- {
- int mytid;
- int tids[SLAVENUM]; /* slave task ids */
- char slave_name[NAMESIZE];
- int nproc, i, who;
- mytid = pvm_mytid();
- nproc=pvm_spawn(SLAVENAME, NULL, PvmTaskDefault, "", SLAVENUM, tids);
- int inst = pvm_joingroup(GROUP1);
- pvm_barrier(GROUP1, 11);
- pvm_initsend(PvmDataDefault);
- pvm_pkint(&mytid, 1, 1);
- pvm_pkint(&i, 1, 1);
- pvm_bcast(GROUP1, MSG_MSTR);
- for( i=0 ; i<nproc ; i++ )
- {
- pvm_recv( -1, MSG_SLV );
- pvm_upkint(&who, 1, 1 );
- pvm_upkstr(slave_name );
- printf("%d: %s\n",who, slave_name);
- }
- pvm_exit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement