var n:=976;	// this is the number to factorize
var m:=12;	// number of processes
var s:Int :: allocated[multiple[]];
var p;
par p from 0 to m - 1
(
	var k:=p;
	var divisor;
	var quotient:Int;
	while (n > 1)
	(		
		divisor:= getprime[k];
		quotient:= n % divisor;
		var remainder:= mod[n,divisor];
		if (remainder == 0)
		(
			n:=quotient;		
		) else ( 
			k:=k + m;
		);
		(s :: allreduce["min"]):=n;
		if ((s==n) && (quotient==n))
		(			
			print[divisor,","];			
		);
		n:=s;
	);
);