add iteration parameter
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java
index 936042e..9b80f8c 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/client/Client.java
@@ -39,7 +39,7 @@
public int sizeKmer;
@Option(name = "-num-iteration", usage = "max number of iterations, for pagerank job only", required = false)
- public long numIteration = -1;
+ public int numIteration = -1;
@Option(name = "-runtime-profiling", usage = "whether to do runtime profifling", required = false)
public String profiling = "false";
@@ -65,9 +65,9 @@
job.getConfiguration().setInt(TwoStepLogAlgorithmForPathMergeVertex.KMER_SIZE, options.sizeKmer);
job.getConfiguration().setInt(ThreeStepLogAlgorithmForPathMergeVertex.KMER_SIZE, options.sizeKmer);
if (options.numIteration > 0){
- job.getConfiguration().setLong(NaiveAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
- job.getConfiguration().setLong(TwoStepLogAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
- job.getConfiguration().setLong(ThreeStepLogAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
+ job.getConfiguration().setInt(NaiveAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
+ job.getConfiguration().setInt(TwoStepLogAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
+ job.getConfiguration().setInt(ThreeStepLogAlgorithmForPathMergeVertex.ITERATIONS, options.numIteration);
}
return options;
}
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/ThreeStepLogAlgorithmForPathMergeVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/ThreeStepLogAlgorithmForPathMergeVertex.java
index 4872829..1a1ef8a 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/ThreeStepLogAlgorithmForPathMergeVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/ThreeStepLogAlgorithmForPathMergeVertex.java
@@ -67,7 +67,7 @@
if(kmerSize == -1)
kmerSize = getContext().getConfiguration().getInt(KMER_SIZE, 5);
if (maxIteration < 0)
- maxIteration = getContext().getConfiguration().getInt(ITERATIONS, 100);
+ maxIteration = getContext().getConfiguration().getInt(ITERATIONS, 20);
}
/**
* get destination vertex
@@ -337,6 +337,8 @@
mergeChainVertex(msgIterator);
}
}
+ else
+ voteToHalt();
}
/**
* @param args
diff --git a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java
index fc0b7aa..526a57c 100644
--- a/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java
+++ b/genomix/genomix-pregelix/src/main/java/edu/uci/ics/genomix/pregelix/operator/TwoStepLogAlgorithmForPathMergeVertex.java
@@ -67,7 +67,7 @@
if(kmerSize == -1)
kmerSize = getContext().getConfiguration().getInt(KMER_SIZE, 5);
if (maxIteration < 0)
- maxIteration = getContext().getConfiguration().getInt(ITERATIONS, 100);
+ maxIteration = getContext().getConfiguration().getInt(ITERATIONS, 20);
}
/**
* get destination vertex
@@ -272,9 +272,6 @@
* head send message to path
*/
public void sendMsgToPathVertex(Iterator<LogAlgorithmMessageWritable> msgIterator){
- if(getSuperstep() == 11){
- System.out.print("hre");
- }
if(getSuperstep() == 3){
msg.reset();
sendMsgToPathVertex(getVertexId(), getVertexValue().getAdjMap());
@@ -328,6 +325,8 @@
else if(getSuperstep()%2 == 0 && getSuperstep() <= maxIteration){
responseMsgToHeadVertex(msgIterator);
}
+ else
+ voteToHalt();
}
/**
* @param args