File: hello_master

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 (29 lines) | stat: -rwxr-xr-x 512 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
#! /usr/bin/env slsh

require ("pvm");

define main()
{
   variable tid = pvm_mytid();
   
   variable path, slave_tid;
   path = path_concat (getcwd(), "hello_slave");
   slave_tid = pvm_spawn (path, PvmTaskHost, "pirx", 1);
   if (slave_tid == PvmNoFile)
     {
	pvm_exit();
	exit (0);
     }
   
   variable bufid, msgid;
   bufid = pvm_recv (-1, -1);
   (,msgid,) = pvm_bufinfo (bufid);

   variable obj = pvm_recv_obj();
   vmessage ("%s says %s", obj.from, obj.msg);

   pvm_exit();
   exit(0);
}

main();