Newsgroups: comp.parallel.pvm
From: enbody@ss65.msu.edu (Richard Enbody)
Subject: Rookie question: pvm_tasks
Organization: Michigan State University, CPS Department
Date: 24 Aug 1994 01:50:49 GMT
Message-ID: <33e91p$13k4@msuinfo.cl.msu.edu>

My goal is to start pairs of tasks on the each machine.

I know I can do that by expliciting stating machines in
the "where" parameter of pvm_spawn.  I would prefer to
not "hard code" the machine names.  

My thought was to spawn a task, ask what machine the task
is on, and then spawn the second task.  To find out the
machine, I planned to use pvm_tasks to find out the "pvmd task ID"
and then use pvm_config to find out the name ("hi_name") of
the machine that that pvmd was running on.

My problem is that pvm_tasks(mytid, ... ) fails.  

Any help would be appreciated. 
Have mercy on me -- I'm new to PVM :-)

Here is my code:

#include "pvm3.h"

main()
{
    int mytid;                  /* my task id */
    int info;                   /* for pvm_tasks */

    int ntask;                  /* pvm_tasks: number of tasks */ 
    struct taskinfo *taskp;     /* array of taskinfo */

    /* enroll in pvm */
    mytid = pvm_mytid();
    printf("mytid = %d\n",mytid);
    
    info = pvm_tasks(mytid, &ntask, &taskp);
    printf("info = %d\n",info);
    printf("ntask = %d\n", ntask);
    /*printf("pvmd task id = %d\n", taskp[0].ti_host);*/
    
    /* Program Finished exit PVM before stopping */
    pvm_exit();
}

Here is a sample output:

<88 ss:~ >bug
mytid = 262153
libpvm [t40009]: pvm_tasks(): No such host
info = -6
ntask = 0

My user guide doesn't tell me what "info = -6" means, except
that it indicates that "some error occured."
A pointer to the location of more error codes would help (I've
obviously missed something in the documentation).

The machine is a Sparc10 running Solaris (SunOS 5.3) and
PVM 3.1, Version 3.1.3.

Thanks,

-rich
enbody@cps.msu.edu

