Updated Branches: refs/heads/trunk 94acaaa54 -> 110d77c55
GIRAPH-311: Master halting in superstep 0 is ignored by workers (majakabiljo) Project: http://git-wip-us.apache.org/repos/asf/giraph/repo Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/110d77c5 Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/110d77c5 Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/110d77c5 Branch: refs/heads/trunk Commit: 110d77c5536f7d5e00c08f4df575cd8de6c75792 Parents: 94acaaa Author: Maja Kabiljo <[email protected]> Authored: Wed Jun 26 15:07:59 2013 -0700 Committer: Maja Kabiljo <[email protected]> Committed: Wed Jun 26 15:07:59 2013 -0700 ---------------------------------------------------------------------- CHANGELOG | 2 ++ .../org/apache/giraph/graph/GraphTaskManager.java | 4 ++-- .../src/test/java/org/apache/giraph/TestBspBasic.java | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/giraph/blob/110d77c5/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index 7d37d52..5804cab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Giraph Change Log Release 1.1.0 - unreleased + GIRAPH-311: Master halting in superstep 0 is ignored by workers (majakabiljo) + GIRAPH-688: Make sure Giraph builds against all compatible YARN-enabled Hadoop versions, warns if none set, works w/new 1.1.0 line (ereisman) http://git-wip-us.apache.org/repos/asf/giraph/blob/110d77c5/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java ---------------------------------------------------------------------- diff --git a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java index f2ad8b6..e7af825 100644 --- a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java +++ b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java @@ -249,7 +249,7 @@ public class GraphTaskManager<I extends WritableComparable, V extends Writable, int numComputeThreads = conf.getNumComputeThreads(); // main superstep processing loop - do { + while (!finishedSuperstepStats.allVerticesHalted()) { final long superstep = serviceWorker.getSuperstep(); GiraphTimerContext superstepTimerContext = getTimerForThisSuperstep(superstep); @@ -286,7 +286,7 @@ public class GraphTaskManager<I extends WritableComparable, V extends Writable, finishedSuperstepStats = completeSuperstepAndCollectStats( partitionStatsList, superstepTimerContext); // END of superstep compute loop - } while (!finishedSuperstepStats.allVerticesHalted()); + } if (LOG.isInfoEnabled()) { LOG.info("execute: BSP application done (global vertices marked done)"); http://git-wip-us.apache.org/repos/asf/giraph/blob/110d77c5/giraph-examples/src/test/java/org/apache/giraph/TestBspBasic.java ---------------------------------------------------------------------- diff --git a/giraph-examples/src/test/java/org/apache/giraph/TestBspBasic.java b/giraph-examples/src/test/java/org/apache/giraph/TestBspBasic.java index c4286ab..0e3503c 100644 --- a/giraph-examples/src/test/java/org/apache/giraph/TestBspBasic.java +++ b/giraph-examples/src/test/java/org/apache/giraph/TestBspBasic.java @@ -494,4 +494,18 @@ public class assertEquals(32.5, finalSum, 0d); } } + + /** + * Test halting at superstep 0 + */ + @Test + public void testHaltSuperstep0() + throws IOException, InterruptedException, ClassNotFoundException { + GiraphConfiguration conf = new GiraphConfiguration(); + GiraphConstants.MAX_NUMBER_OF_SUPERSTEPS.set(conf, 0); + conf.setComputationClass(SimpleMsgComputation.class); + conf.setVertexInputFormatClass(SimpleSuperstepVertexInputFormat.class); + GiraphJob job = prepareJob(getCallingMethodName(), conf); + assertTrue(job.run(true)); + } }
