3 // This file defines a set of utility routines for RPC services.
9 #include <util/h/rpcUtilPVM.h>
12 // Starts the 'program' on 'machine' and saves its thread id
14 PVMrpc::PVMrpc(char *where, char *program, char **argv, int flag)
18 if ((my_tid = pvm_mytid()) < 0)
22 if (pvm_spawn(program, argv, flag, where, 1, &other_tid) != 1)
28 // Accepts id of other thread
30 PVMrpc::PVMrpc(int other)
32 if ((my_tid = pvm_mytid()) < 0)
46 if ((my_tid = pvm_mytid()) < 0)
49 { if ((other_tid = pvm_parent()) < 0) pvm_error = -1;}
58 if (pvm_error == -1) return -1;
59 if ((bufid = pvm_probe(other_tid, -1)) < 0)
63 else if (other_tid == -1)
65 else if ((pvm_tasks(other_tid, &count, &tp) < 0) ||
67 (tp->ti_tid != other_tid))
68 return (pvm_probe (other_tid, -1));