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 ();
|