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