3 * This file defines a set of utility routines for RPC services.
5 * $Log: rpcUtilPVM.C,v $
6 * Revision 1.3 1994/06/15 15:09:23 markc
7 * Rename taskinfo to pvmtaskinfo.
9 * Revision 1.2 1994/05/17 00:14:46 hollings
10 * added rcs log entry.
17 #include <util/h/rpcUtilPVM.h>
20 // Starts the 'program' on 'machine' and saves its thread id
22 PVMrpc::PVMrpc(char *where, char *program, char **argv, int flag)
26 if ((my_tid = pvm_mytid()) < 0)
30 if (pvm_spawn(program, argv, flag, where, 1, &other_tid) != 1)
36 // Accepts id of other thread
38 PVMrpc::PVMrpc(int other)
40 if ((my_tid = pvm_mytid()) < 0)
54 if ((my_tid = pvm_mytid()) < 0)
57 { if ((other_tid = pvm_parent()) < 0) pvm_error = -1;}
64 struct pvmtaskinfo *tp;
66 if (pvm_error == -1) return -1;
67 if ((bufid = pvm_probe(other_tid, -1)) < 0)
71 else if (other_tid == -1)
73 else if ((pvm_tasks(other_tid, &count, &tp) < 0) ||
75 (tp->ti_tid != other_tid))
76 return (pvm_probe (other_tid, -1));