hello.c
, the main program
#include <pvm3.h> main () { int tid ; char reply [100] ; printf ("I'm t%x\n", pvm_mytid ()) ; if (pvm_spawn("hello_other", (char**)0, 0, "", 1, &tid) == 1) { pvm_recv (-1, -1) ; pvm_bufinfo (pvm_getrbuf (), (int*)0, (int*)0, &tid) ; pvm_upkstr(reply) ; printf (From t%x: %s\n", tid, reply) ; } else printf ("Can't start hello_other\n") ; pvm_exit () ; }
hello_other.c
, the auxiliary program
#include <pvm3.h> main () { int ptid ; /* parent's tid */ char buf [100] ; ptid = pvm_parent () ; strcpy (buf, "Hello world from ") ; gethostname (buf+strlen(buf), 64) ; pvm_initsend (PvmDataDefault) ; pvm_pkstr (buf) ; pvm_send (ptid, 1) ; pvm_exit () ; }