#include "pvm3.h" #include "stdlib.h" #include "stdio.h" #include "string.h" int main() { // the id of a task int tid; // pvm_spawn: starts the program // program to run // command line parameters // flag // host -> empty because we work on one computer // the number of copies we want to start of the process int success = pvm_spawn("/home.local/valaki/hello_client", NULL, 0, "", 1, &tid); if(success < 0) { exit(EXIT_FAILURE); } // waiting for a message // tid -> from where // tag -> with which tag // -1,-1 means that the message can come from every task and with every tag pvm_recv(-1,-1); char buf[100]; //unwrap the message pvm_upkstr(buf); printf("%s\n", buf); }