Newsgroups: comp.parallel.pvm
From: subraman@cs.iastate.edu (Krishnan Subramaniam)
Subject: problems in pvm3.3.6 ??
Keywords: blocking on select
Organization: Iowa State University, Ames, Iowa
Date: 7 Feb 95 01:48:02 GMT
Message-ID: <subraman.792121682@shazam.cs.iastate.edu>

Hi,
	This is follow up posting to the ther one about
pvm3.3.4
	I've installed pvm3.3.6 the lates version. It still
gives me the same problem of blocking on the select routine or
somewhere else. The code I have is :

#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
#include <math.h>
#include "pvm3.h"
#include "hosts.h"

#define NMESG 	25
#define NPROC   7

int nproc,routing_option;
int my_tid,my_parent;
int slave_tids[32];


main(argc,argv)
int argc;
char *argv[];
{
int i,k;
my_tid = pvm_mytid();
my_parent = pvm_parent();
routing_option = PvmRouteDirect;
pvm_setopt(PvmRoute,routing_option);

if (my_parent == PvmNoParent)
{
for (i=0;i<NPROC-1;i++)
	{
	k = pvm_spawn(SLAVE, (char**)0,PvmTaskHost,hosts[i%NHOSTS],1,slave_tids+i+1);
	if (k != 1)
		{
		printf("\n PVM:Error in starting task tid errcode = %d == %x",slave_tids[i],slave_tids[i]);
		pvm_exit();
		}
	}
sleep(5);
}
else 
{
int i;
for (i=0;i<NMESG;i++)
	{
pvm_initsend(PvmDataRaw);
pvm_pkint(&my_tid,1,1);
pvm_send(my_parent,9);
	}
puts("Slave sent data");
fflush(stdout);
pvm_exit();
exit();
/*   SLAVE QUITS HERE   */
}
start_time();
work();
}



int i,j;

void work()
{


for (i=0;i<(NPROC-1)*NMESG;i++)
	{
	pvm_recv(-1,9);
	pvm_upkint(&j,1,1);
	printf ("RECVD FROM T%x CNT = %d\n",j,i);
	fflush(stdout);
	}
pvm_exit();
exit();

}


NHOSTS and hosts are defined in another file which just has an array
of host names and NHOSTS == #of hosts i have.
The program just spawns of NPROC-1 children so that I have in all
NPROC tasks and then waits for messages from them.
Each of the children send back NMESG messages (==25).
The program sometimes blocks when it executes the first pvm_recv
and sometimes after getting all data from a slave.
I added some debug puts("Entered routine XXXX") kind of statements
to the src code in pvm and it seems to ME that it is blocking
in the select in mroute ! (3.3.6 is supposed to have solved the -1
problem).
ANY clues ??

krishnan.
--
Krishnan R Subramaniam
Voice Mail : 515 - 296 4209.
Email	   : subraman@cs.iastate.edu   
HTML  	   : http://www.public.iastate.edu/~rsk/

