Newsgroups: comp.parallel.pvm
From: crispin@csd.uwo.ca (Crispin Cowan)
Subject: Re: get socket address given a task ID
Organization: Department of Computer Science, University of Western Ontario, London, Ontario, Canada
Date: 20 Jun 1994 03:51:53 GMT
Message-ID: <2u33op$km2@falcon.ccs.uwo.ca>

In article <CMM.0.90.2.771888028.li@ground.cs.columbia.edu>,
Zhe Li <li@cs.columbia.edu> wrote:
>Any hints on how to get the slave task's socket address and port number given
>its task ID? How to do the same thing for the local pvmd?

The connection data structures are entirely contained in the lpvm.c
file in the src directory.  The specific structure is called ttpcb,
shown here (taken from pvm 3.2.6):

struct ttpcb {
	struct ttpcb *tt_link;			/* dll of peers */
	struct ttpcb *tt_rlink;
	int tt_tid;						/* tid of peer or 0 if master of list */
	int tt_state;
	int tt_fd;						/* fd of connection or -1 */
	struct sockaddr_in tt_sad;		/* address of our socket */
	struct sockaddr_in tt_osad;		/* (authd) address of peer socket */
	struct umbuf *tt_rxfrag;		/* not-assembled incm msg */
	struct frag *tt_rxf;			/* partial incm frag */
};

There are two significant uses of ttpcb stucts in lpvm:  one is the
global struct ttpcb * topvmd, which is a pointer to the descriptor for
the connection from a task to it's pvmd.  The other is struct ttpcb *
ttlist, which is a DLL of "direct routing" connections to other tasks.

Getting at these structures is your problem, as I am not aware of
system calls to give you the data.  I suppose you could hack up a
system call that would give it to you, but it would not be portable to
non-hacked PVM systems.

Crispin
-----
Crispin Cowan, CS PhD student, searching for a research position
University of Western Ontario
Phyz-mail:  Middlesex College, MC28-C, London, Ontario, N6A 5B7
E-mail:     crispin@csd.uwo.ca          Voice:  519-661-3342
"A distributed system is one in which I cannot get something done
because a machine I've never heard of is down"   --Leslie Lamport

