Skip to content

Commit

Permalink
Minor touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaderberg committed Oct 24, 2023
1 parent c6a49ce commit 2f02466
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void traverse() {
ForkJoinPool forkJoinPool = ExecutorServiceUtil.createForkJoinPool(concurrency);
var tasks = ConcurrentHashMap.<ForkJoinTask<Void>>newKeySet();

LongFunction<CountedCompleter> taskProducer =
LongFunction<CountedCompleter<Void>> taskProducer =
(nodeId) -> new LongestPathTask(
null,
nodeId,
Expand All @@ -125,8 +125,7 @@ private void traverse() {
ParallelUtil.parallelForEachNode(nodeCount, concurrency, TerminationFlag.RUNNING_TRUE, nodeId -> {
if (inDegrees.get(nodeId) == 0L) {
tasks.add(taskProducer.apply(nodeId));
parentsAndDistances.predecessors().get().set(nodeId, nodeId);
parentsAndDistances.distances().set(nodeId, 0);
parentsAndDistances.set(nodeId, nodeId, 0);
}
// Might not reach 100% if there are cycles in the graph
progressTracker.logProgress();
Expand All @@ -146,7 +145,7 @@ private static final class LongestPathTask extends CountedCompleter<Void> {
private final long sourceId;
private final Graph graph;
private final HugeAtomicLongArray inDegrees;
private TentativeDistances parentsAndDistances;
private final TentativeDistances parentsAndDistances;

LongestPathTask(
@Nullable DagLongestPath.LongestPathTask parent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static DistanceAndPredecessor distanceAndPredecessors(
return distanceAndPredecessors(size, concurrency, DIST_INF, (a, b) -> Double.compare(a, b) > 0);
}

public static DistanceAndPredecessor distanceAndPredecessors(
static DistanceAndPredecessor distanceAndPredecessors(
long size,
int concurrency,
double distanceDefault,
Expand Down

0 comments on commit 2f02466

Please sign in to comment.