File: pvmstatus

package info (click to toggle)
slpvm 0.1.5-17
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,184 kB
  • sloc: sh: 2,624; ansic: 1,012; makefile: 161
file content (31 lines) | stat: -rwxr-xr-x 604 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/env slsh

import ("pvm");
static variable TASK_STATUS_MSG		= 1005;

define show_status (tid)
{
   variable my_tid = pvm_mytid ();
   variable s = pvm_tasks (tid);
   if (s == NULL)
     {
	() = fprintf (stderr, "Task with tid=%d does not appear to exist\n",
		      tid);
	exit (1);
     }
   
   pvm_initsend (PvmDataDefault);
   pvm_send (tid, TASK_STATUS_MSG);
   () = pvm_recv (-1, TASK_STATUS_MSG);
   message (pvm_unpack (String_Type));
}

if (__argc == 1)
{
   () = fprintf (stderr, "Usage: %s MASTER-TID\n", __argv[0]);
   exit (1);
}

show_status (integer (__argv[1]));
pvm_exit ();