Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Commit

Permalink
remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
mneedham committed Mar 12, 2019
1 parent 7633780 commit d847f82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,4 @@ void normalizeDeltas() {
deltas[i] = deltas[i] / l2Norm;
}
}

@Override
public String toString() {
return "EigenvectorCentralityComputeStep{" +
"partitionSize=" + partitionSize +
", startNode=" + startNode +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ CentralityResult getPageRank() {
private void run(int iterations) {
// initialize data structures
ParallelUtil.runWithConcurrency(concurrency, steps, pool);
for (int i = 0; i < iterations && running(); i++) {
for (int iteration = 0; iteration < iterations && running(); iteration++) {
// calculate scores
ParallelUtil.runWithConcurrency(concurrency, steps, 3, 1, TimeUnit.SECONDS, pool);

Expand Down Expand Up @@ -382,7 +382,8 @@ private double computeNorm() {
}

l2Norm = Math.sqrt(l2Norm);
l2Norm = l2Norm < 0 ? 1: l2Norm;

l2Norm = l2Norm <= 0 ? 1 : l2Norm;
return l2Norm;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ private static void runWithConcurrency(
int maxWaitRetries,
TerminationFlag terminationFlag,
ExecutorService executor) {

if (!canRunInParallel(executor)
|| tasks.size() == 1
|| concurrency <= 1) {
Expand Down Expand Up @@ -705,9 +704,7 @@ private static void runWithConcurrency(
while (ts.hasNext()) {
if (completionService.hasTasks()) {
try {
System.out.println("[ParallelUtil#runWithConcurrency] waiting for task to finish... " + executor);
completionService.awaitNext();
System.out.println("[ParallelUtil#runWithConcurrency] task finished... " + executor);
} catch (ExecutionException e) {
error = Exceptions.chain(error, e.getCause());
} catch (CancellationException ignore) {
Expand Down Expand Up @@ -884,7 +881,6 @@ protected void done() {
if (executor instanceof ThreadPoolExecutor) {
pool = (ThreadPoolExecutor) executor;
availableConcurrency = pool.getCorePoolSize();
// availableConcurrency = 2;
int capacity = Math.max(targetConcurrency, availableConcurrency) + 1;
completionQueue = new ArrayBlockingQueue<>(capacity);
} else {
Expand Down

0 comments on commit d847f82

Please sign in to comment.