giraph-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Etienne Dumoulin <etienne.dumou...@idiro.com>
Subject Re: How to use an aggregator to halt ?
Date Mon, 23 Jul 2012 15:17:39 GMT
Hi Alessandro,

Thanks, look like the API evolved since the 0.1 version which was the
version I used...

Etienne

On 22 July 2012 21:21, Alessandro Presta <alessandro@fb.com> wrote:

>  Hi,
>
>  The right place to unilaterally halt the computation is MasterCompute,
> of which only one instance exists for the whole job.
> I haven't had any experience with aggregators yet, but you should be able
> to read their values from inside MasterCompute#compute().
>
>  Alessandro
>
>   From: Etienne Dumoulin <etienne.dumoulin@idiro.com>
> Reply-To: "user@giraph.apache.org" <user@giraph.apache.org>
> Date: Sunday, July 22, 2012 9:16 PM
> To: "giraph-user@incubator.apache.org" <giraph-user@incubator.apache.org>
> Subject: How to use an aggregator to halt ?
>
>  Hi everyone,
>
> I implement a pagerank very similar to the one given
> in the example package.
>
> However I would like to do a halt condition with an aggregator:
> I am calculating the sum of all the vertex values at each step.
> I am stopping when the average of the difference is bellow a certain
> point.
>
> So I have extended a WorkerContext class. It does not look like
> I can stop the process from the method postSuperStep(), so I try
> to set a boolean somewhere readable by the vertex.
> Where can I set it?
>
> -I tried to do a getWorkerContext, cast into my type and then call my own
> method:
> if ( ((MyWorkerContext)getWorkerContext()).isEnd();
>     ) {
>        voteToHalt();
> }else{...
> }
>
> -I tried to set a boolean into the Configuration from the WorkerContext and
> get it back into the Vertex.
> if ( getWorkerContext().getContext().getConfiguration().getBoolean("end",
> false)
>     ) {
>        voteToHalt();
> }else{...
> }
>
> Thanks,
>
> Etienne
>
>

Mime
View raw message