You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@giraph.apache.org by Maja Kabiljo <ma...@fb.com> on 2014/01/08 21:31:14 UTC

Re: Extending AbstractComputation

Hi Pushparaj and Peter,

There is going to be one Computation per partition in each of the supersteps. Each partition is processed by a single thread, so accessing any data inside of your Computation is thread-safe. Multiple threads are going to be executing computation on multiple partitions, and therefore not interfere with each other. The only part which you have to worry about synchronization is if you are using pre/postSuperstep and accessing some global data from WorkerContext.

Regards,
Maja

From: Peter Grman <pe...@gmail.com>>
Reply-To: "user@giraph.apache.org<ma...@giraph.apache.org>" <us...@giraph.apache.org>>
Date: Monday, December 23, 2013 3:03 PM
To: "user@giraph.apache.org<ma...@giraph.apache.org>" <us...@giraph.apache.org>>
Subject: Re: Extending AbstractComputation

I don't know the exact logic, maybe somebody who does could elaborate on that, but I noticed that it was used multiple times for different Nodes, I would think that it is used as a pool to minimize the number of object created, am I right here?

The question I would add, can it be that the compute function is called concurrently on multiple objects or is it really a pool and the calls to the function don't interfere with each other?

Thank
Peter

-----------------------------------------------
Imagination is more important than knowledge. For knowledge is limited, whereas imagination embraces the entire world, stimulating progress, giving birth to evolution. It is, strictly speaking, a real factor in scientific research.
- Albert Einstein


On Mon, Dec 23, 2013 at 8:56 PM, Pushparaj Motamari <pu...@gmail.com>> wrote:
Hi,

The class we write extending AbstractComputation, is instantiated one per worker?

Thanks

Pushparaj