#! /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();
