Parallel Virtual Machine on Linux

C programming forum.

Parallel Virtual Machine on Linux

Postby QuantumKnot on March 23rd, 2008, 12:35 am

It's been a while since I touched PVM (since ACS back in 1998) so I thought I'd revisit it after 10 years and see if it still works with modern linux machines. I manually compiled pvm3 on maxwell (since I don't have root access) and ran a PVM across ss64 and maxwell. I ran the simple master-slave "hello" example that came with pvm3.

"hello.c"
Code: Select all
#include <stdio.h>
#include "pvm3.h"

main()
{
        int cc, tid;
        char buf[100];

        printf("i'm t%x\n", pvm_mytid());

        cc = pvm_spawn("hello_other", (char**)0, 0, "", 1, &tid);

        if (cc == 1) {
                cc = pvm_recv(-1, -1);
                pvm_bufinfo(cc, (int*)0, (int*)0, &tid);
                pvm_upkstr(buf);
                printf("from t%x: %s\n", tid, buf);

        } else
                printf("can't start hello_other\n");

        pvm_exit();
        exit(0);
}


"hello_other.c"
Code: Select all
#include "pvm3.h"

main()
{
        int ptid;
        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();
        exit(0);
}


XPVM has some nice eyecandy (for its day) but I had to install an older version of tcl (8.4.9) to get it to work properly.

pvm.png
pvm.png (327.16 KB) Viewed 30 times


Looks like it still works, so I'm rather impressed :mrgreen:
Image
User avatar
QuantumKnot
Member
 
Posts: 99
Joined: January 21st, 2008, 11:58 am

Return to C

Who is online

Users browsing this forum: No registered users and 0 guests

cron

dsplabs homelinux bloglinux forums new! travel photographyawklores new! cryptographyjames' home
©2009 dsplabs.com.au