Newsgroups: comp.parallel.pvm
From: Arindam Chatterjee <achatter@cs.wright.edu>
Subject: -help with bug!
Organization: Wright State University
Date: Wed, 27 Mar 1996 02:28:40 -0500
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-ID: <Pine.ULT.3.91.960327020937.4035A-100000@kiwi.cs.wright.edu>


Hi!

I am currently porting an implementation of a parallel join algorithm 
from the Intel Paragon to PVM on a network of ALPHA workstations. The 
code, written in C, works fine on the Intel Paragon while using native 
Paragon system calls for message passing.

However, the program on the ALPHA machine, now using PVM calls for
message-passing, gives me problems. The problem is occurring with most
dynamic memory allocation function calls, especially the realloc()
routine. 

The realloc() routine sometimes returns with a NULL pointer with the 
error message 'Invalid Argument'. This according to the man pages, 
happens if the area that is being freed by the realloc() routine is 
already free. However, the only thing that is being done prior to the 
realloc() call is message-passing using the PVM function calls.

A section of the code is given below :

Info = pvm_recv( srcID, mtype ) ; 
Info = pvm_upkint( &ToBeRecv, 1, 1 ) ;
printf("To Recv = %d\n", ToBeRecv ) ;
Tuples = ( TUPLE *)realloc(Tuples, sizeof(TUPLE)*(ToBeRecv+ToBeSent)) ;
if (Tuples == NULL )
{
	perror("Mem Error ") ;
	pvm_exit() ;
}

About 50 % of the times, the realloc() returns with a NULL. There are 
other parts of the program which have a similar structure and are also 
prone to such problems.

Could any of you guys give me some pointers as to what could be going
wrong ? As I said before, this code works perfectly fine when run on
Paragon without the PVM calls. It gives me problems ONLY with PVM on ALPHA
workstations. Does PVM interfere with the dynamic memory management system
of a program ? 

Any kind of help is appreciated !!

Thanks in advance,
Arindam
_________________________________________________________________________
"A look at this world and I notice its turning 
While my guitar gently weeps 
Every mistake we must surely be learning, 
While my guitar gently weeps" - George Harrison
_________________________________________________________________________
				ARINDAM CHATTERJEE

314 Russ Engineering Center,			2314 Aptt. #6,
Deptt. of Computer Science & Engg.,		Meadow Run,       	
Wright State University,			Duncan Drive, 
Dayton, Ohio 45435.				Faiborn, OH 45324
							
Tel    : (513)-427-1838
e-mail : achatter@valhalla.cs.wright.edu
	 ceg434ta@gamma.cs.wright.edu
_________________________________________________________________________


