[Beowulf] Seg Fault with pvm_upkstr() and Linux.

Josh Zamor jzamor at gmail.com
Tue Mar 15 02:51:36 EST 2005


I have just started in on programming using PVM and have run into an 
odd problem. I have written a C (c99) program that calculates the 
factorial of a number by calculating parts of the range. I'm using the 
GMP for dealing with large numbers (I have done this program 
successfully before using numerous methods including pthreads). The 
basic way it works for the cluster is that the program starts on a 
machine, determines the subrange to be calculated for each task and 
then waits for each process to come back with the answer for it's 
subrange. The main process then finds the total result of the factorial 
from multiplying the subrange results back together... Pretty 
standard...

The problem is that after a subrange is calculated by a task the result 
is put into a character array (null terminated, created from GMP's 
mpz_getstr()), it is packaged using pvm_pkstr() and sent to the parent. 
The parent can receive this using pvm_recv(), but as soon as it tries 
to store this into a character array in the program using pvm_upkstr(), 
or explore it with pvm_bufinfo(), it segfaults.

I've also tried this in a couple of different ways, passing ints, it 
works, but passing strings (either large or small) results in a 
segfault.

Of my 2 "cluster" learning setup one is running Mac OSX and the other 
is running Gentoo Linux. It is only the linux box that segfaults, the 
OSX box finds the answer correctly. The segfault happens whenever the 
linux box is part of the PVM created cluster, or when PVM is ran alone 
(no other boxes in the cluster) on the linux box.

If anyone has any idea why this is happening, or is only happening on 
the linux box I would be grateful. Thanks, tech details follow:

Gentoo Linux Box:
	Proc: AMD AthlonXP 1700+
	RAM: 512MB.
	Kernel: 2.4.26-gentoo-r9
	PVM: 3.4.5
	GMP: 4.1.4
	GCC: 3.3.5

Mac OSX:
	Proc: G4 1GHz
	RAM: 768MB
	Kernel: 10.3.8, Mach 7.8.0
	PVM: 3.4.5
	GMP: 4.1.4
	GCC: 3.3 (20030304)

Thanks again.

Regards,
-J Zamor
jzamor at gmail.com

_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list