Newsgroups: comp.parallel.pvm
Path: ukc!uknet!pipex!howland.reston.ans.net!news.intercon.com!psinntp!hk.super.net!uxmail!hpg30a.csc.cuhk.hk!hp9000.csc.cuhk.hk!cpccspc.cphk.hk!hkpu01!cs005688
From: cs005688@hkpu01 (Hello World!!)
Subject: Error on pvm_parent
Message-ID: <CJJrKu.Eu0@cpccspc.cphk.hk>
Sender: usenet@cpccspc.cphk.hk
Nntp-Posting-Host: hkpu01.hkp.hk
Organization: Hong Kong Polytechnic
X-Newsreader: TIN [version 1.1 PL9]
Date: Thu, 13 Jan 1994 02:43:42 GMT
Lines: 70

Helo PVM gurus

I have problems with PVM!! I have written two simple but it just fails.

Program 1 : test.c
#include <stdlib.h>
#include <stdio.h>
#include <pvm3.h>
#define SLAVENAME "tests"
main()
{
    int mytid;
    int tids[32];
    int n, nproc, i;

    mytid = pvm_mytid();

    nproc = 1;

    pvm_spawn(SLAVENAME, (char**)0, 12, "", nproc, tids);

    for (i=0;i<nproc;++i)
        printf("\nThe tids[%d] of tests in test : %d\n", i, tids[i]);

    for (i=0;i<nproc;++i)
    {
        pvm_recv(-1, -1);
        pvm_pkint(n, 1, 1);
        printf("\nReturn message from tids : %d\n", n);
    }
}


=========================================================================================

Program 2 : tests.c
#include <stdlib.h>
#include <stdio.h>
#include <pvm3.h>

void main()
{
    int mytid;
    int n, parent;

    mytid = pvm_mytid();
    parent = pvm_parent();

    pvm_initsend(PvmDataDefault);
    pvm_pkint(&mytid, 1, 1);
    pvm_send(parent, 1);

    pvm_exit();
    exit();
}


The problem is that test never receive the message from tests.  After using xdbx, I found that the return value of pvm_parent is -23, which is "PvmNoParent".  But it is spawned by the test and it should find its parent exist!!

I really don't know what is wrong !?

Lincoln Wong

+-----------------------------------------------------+
|                                                     |
|  Lincoln Wong Chun                                  |
|  E-mail address : cs056888@comp.hkp.hk              |
|                                                     |
+-----------------------------------------------------+


