1TASKS(3PVM) PVM Version 3.4 TASKS(3PVM)
2
3
4
6 pvm_tasks - Returns information about the tasks running on the virtual
7 machine.
8
9
11 C int info = pvm_tasks( int where, int *ntask, struct pvmtaskinfo **taskp )
12
13 struct pvmtaskinfo {
14 int ti_tid;
15 int ti_ptid;
16 int ti_host;
17 int ti_flag;
18 char *ti_a_out;
19 } taskp;
20
21
22 Fortran call pvmftasks( where, ntask, tid, ptid, dtid, flag, aout, info )
23
24
26 where Integer specifying what tasks to return information about. The
27 options are:
28
29 0 for all the tasks on the virtual machine
30 pvmd tid for all tasks on a given host
31 tid for a specific task
32
33
34 ntask Integer returning the number of tasks being reported on.
35
36 taskp Returns pointer to an array of structures which contain infor‐
37 mation about each task including its task ID, parent tid, pvmd
38 task ID, status flag, and the name of this task's executable
39 file. The status flag values are: waiting for a message, wait‐
40 ing for the pvmd, and running.
41
42 tid Integer returning task ID of one task
43
44 ptid Integer returning parent task ID
45
46 dtid Integer returning pvmd task ID of host task is on.
47
48 flag Integer returning status of task
49
50 aout Character string returning the name of spawned task. Manually
51 started tasks return blank.
52
53 info Integer status code returned by the routine. Values less than
54 zero indicate an error.
55
56
58 The routine pvm_tasks returns information about tasks presently running
59 on the virtual machine. The information returned is the same as that
60 available from the console command ps. The C function returns informa‐
61 tion about the entire virtual machine in one call. The Fortran function
62 returns information about one task per call and cycles through all the
63 tasks. Thus, if where = 0, and pvmftasks is called ntask times, all
64 tasks will be represented.
65
66 Note that in Fortran the reported value of ntask and the set of tasks
67 do not change until the function resets at the end of a complete cycle.
68 The user can reset pvmftasks() at any time by calling it with ntask =
69 -1.
70
71 If pvm_tasks is successful, info will be 0. If some error occurs then
72 info will be < 0.
73
74
76 C:
77 struct pvmtaskinfo *taskp;
78 int i, ntask;
79
80 info = pvm_tasks( 0, &ntask, &taskp );
81 for (i = 0; i < ntask; i++)
82 printf("t%x\n", taskp[i].ti_tid);
83 Fortran:
84 Do i=1, NTASK
85 CALL PVMFTASKS( DTID, NTASK, TID(i), PTID(i), DTID(i),
86 & FLAG(i), AOUT(i), INFO )
87 EndDo
88
89
91 The following error condition can be returned by pvm_tasks
92
93 PvmBadParam
94 invalid value for where argument.
95
96 PvmSysErr
97 pvmd not responding.
98
99 PvmNoHost
100 specified host not in virtual machine.
101
103 pvm_config(3PVM), pvm_tidtohost(3PVM)
104
105
106
107 31 August, 1994 TASKS(3PVM)