Skip to content

Commit d55c510

Browse files
triceolee-carlon
andauthored
docs: restucture multi-threaded section (#1269)
Co-authored-by: lee-carlon <[email protected]>
1 parent ab27eef commit d55c510

File tree

7 files changed

+39
-34
lines changed

7 files changed

+39
-34
lines changed

docs/src/modules/ROOT/pages/enterprise-edition/enterprise-edition.adoc

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ as shown in the following table:
154154
The following features are only available in Timefold Solver Enterprise Edition:
155155

156156
* <<nearbySelection,Nearby selection>>,
157-
* <<multithreadedSolving,multi-threaded solving>>,
157+
* <<multithreadedIncrementalSolving,multi-threaded incremental solving>>,
158158
* <<partitionedSearch,partitioned search>>,
159159
* <<automaticNodeSharing,automatic node sharing>>,
160160
* and <<throttlingBestSolutionEvents, throttling best solution events>>.
@@ -457,42 +457,26 @@ only set the distribution type (so without a `distributionSizeMaximum` parameter
457457
----
458458

459459

460-
[#multithreadedSolving]
460+
[#enterpriseMultithreadedSolving]
461461
=== Multi-threaded solving
462462

463-
[NOTE]
464-
====
465-
This feature is a commercial feature of Timefold Solver Enterprise Edition.
466-
It is not available in the Community Edition.
467-
====
468-
469-
There are several ways of doing multi-threaded solving:
463+
Multi-threaded solving is a term
464+
which encapsulates several features that allow Timefold Solver to run on multi-core machines.
465+
Timefold Solver Enterprise Edition makes multi-threaded solving more powerful by introducing
466+
<<multithreadedIncrementalSolving,multi-threaded incremental solving>> and
467+
<<partitionedSearch,partitioned search>>.
470468

471-
* *<<multithreadedIncrementalSolving,Multi-threaded incremental solving>>*:
472-
Solve 1 dataset with multiple threads without sacrificing xref:constraints-and-score/performance.adoc#incrementalScoreCalculationPerformance[incremental score calculation].
473-
** Donate a portion of your CPU cores to Timefold Solver to scale up the move evaluation speed and get the same results in fraction of the time.
474-
* *<<partitionedSearch,Partitioned Search>>*:
475-
Split 1 dataset in multiple parts and solve them independently.
476-
* *Multi bet solving*: solve 1 dataset with multiple, isolated solvers and take the best result.
477-
** Not recommended: This is a marginal gain for a high cost of hardware resources.
478-
** Use the xref:using-timefold-solver/benchmarking-and-tweaking.adoc#benchmarker[Benchmarker] during development to determine the algorithm that is the most appropriate on average.
479-
* *Multitenancy*: solve different datasets in parallel.
480-
** The xref:using-timefold-solver/running-the-solver.adoc#solverManager[`SolverManager`] can help with that.
469+
For a primer on multi-threaded solving in general, see xref:using-timefold-solver/running-the-solver.adoc#multithreadedSolving[Multi-threaded solving].
481470

482-
image::enterprise-edition/multiThreadingStrategies.png[align="center"]
483-
484-
In this section, we will focus on multi-threaded incremental solving and partitioned search.
471+
[#multithreadedIncrementalSolving]
472+
==== Multi-threaded incremental solving
485473

486474
[NOTE]
487475
====
488-
A xref:using-timefold-solver/running-the-solver.adoc#logging[logging level] of `debug` or `trace` might cause congestion
489-
and slow down the xref:constraints-and-score/performance.adoc#moveEvaluationSpeed[move evaluation speed].
476+
This feature is a commercial feature of Timefold Solver Enterprise Edition.
477+
It is not available in the Community Edition.
490478
====
491479

492-
493-
[#multithreadedIncrementalSolving]
494-
==== Multi-threaded incremental solving
495-
496480
With this feature, the solver can run significantly faster,
497481
getting you the right solution earlier.
498482
It has been designed to speed up the solver in cases where move evaluation is the bottleneck.

docs/src/modules/ROOT/pages/upgrading-timefold-solver/upgrade-to-latest-version.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ see xref:enterprise-edition/enterprise-edition.adoc#switchToEnterpriseEdition[th
319319
.icon:info-circle[role=yellow] `LookupStrategyType` deprecated for removal
320320
[%collapsible%open]
321321
====
322-
`LookupStrategyType` is used in xref:enterprise-edition/enterprise-edition.adoc#multithreadedSolving[multi-threaded solving]
322+
`LookupStrategyType` is used in xref:enterprise-edition/enterprise-edition.adoc#multithreadedIncrementalSolving[multi-threaded incremental solving]
323323
to specify how the solver should match entities and facts between parent and child score directors.
324324
The default value is `PLANNING_ID_OR_NONE`, which means
325325
that the solver will look up entities by their xref:using-timefold-solver/modeling-planning-problems.adoc#planningId[planning ID].

docs/src/modules/ROOT/pages/using-timefold-solver/benchmarking-and-tweaking.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,8 @@ for example when running benchmarks on an application server or a cloud platform
10861086
10871087
[NOTE]
10881088
====
1089-
This feature is independent of xref:enterprise-edition/enterprise-edition.adoc#multithreadedSolving[multithreaded solving].
1089+
This feature is independent of xref:enterprise-edition/enterprise-edition.adoc#multithreadedIncrementalSolving[multi-threaded incremental solving] (an enterprise feature),
1090+
and can be used in Timefold Solver Community Edition as well.
10901091
====
10911092
10921093

docs/src/modules/ROOT/pages/using-timefold-solver/modeling-planning-problems.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Alternatively, you can sometimes also introduce <<cachedProblemFact,_a cached pr
150150
=== `@PlanningId`
151151

152152
For some functionality
153-
(such as xref:enterprise-edition/enterprise-edition.adoc#multithreadedSolving[multi-threaded solving]
153+
(such as xref:enterprise-edition/enterprise-edition.adoc#multithreadedIncrementalSolving[multi-threaded incremental solving]
154154
and xref:responding-to-change/responding-to-change.adoc#realTimePlanning[real-time planning]),
155155
Timefold Solver needs to map problem facts and planning entities to an ID.
156156
Timefold Solver uses that ID to _rebase_ a move from one thread's solution state to another's.

docs/src/modules/ROOT/pages/using-timefold-solver/running-the-solver.adoc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,25 @@ The solution instance given to the `solve(Solution)` method does not need to be
9898
It can be partially or fully initialized, which is often the case in xref:responding-to-change/responding-to-change.adoc[repeated planning].
9999
====
100100

101+
[#multithreadedSolving]
102+
=== Multi-threaded solving
103+
104+
There are several ways of running the solver in parallel:
105+
106+
* *xref:enterprise-edition/enterprise-edition.adoc#multithreadedIncrementalSolving[Multi-threaded incremental solving]*:
107+
Solve 1 dataset with multiple threads without sacrificing xref:constraints-and-score/performance.adoc#incrementalScoreCalculationPerformance[incremental score calculation].
108+
This is an exclusive feature of the xref:enterprise-edition/enterprise-edition.adoc[Enterprise Edition].
109+
110+
* *xref:enterprise-edition/enterprise-edition.adoc#partitionedSearch[Partitioned search]*:
111+
Split 1 dataset in multiple parts and solve them independently.
112+
This is an exclusive feature of the xref:enterprise-edition/enterprise-edition.adoc[Enterprise Edition].
113+
* *Multi bet solving*: solve 1 dataset with multiple, isolated solvers and take the best result.
114+
** Not recommended: This is a marginal gain for a high cost of hardware resources.
115+
** Use the xref:using-timefold-solver/benchmarking-and-tweaking.adoc#benchmarker[Benchmarker] during development to determine the algorithm that is the most appropriate on average.
116+
* *Multitenancy*: solve different datasets in parallel.
117+
** The xref:using-timefold-solver/running-the-solver.adoc#solverManager[`SolverManager`] can help with this.
118+
119+
image::using-timefold-solver/running-the-solver/multiThreadingStrategies.png[align="center"]
101120

102121
[#environmentMode]
103122
== Environment mode: are there bugs in my code?
@@ -262,7 +281,8 @@ Even `debug` logging can slow down performance considerably for fast stepping al
262281
(such as Late Acceptance and Simulated Annealing),
263282
but not for slow stepping algorithms (such as Tabu Search).
264283
265-
Both cause congestion in xref:enterprise-edition/enterprise-edition.adoc#multithreadedSolving[multi-threaded solving] with most appenders, see below.
284+
Both trace logging and debug logging cause congestion in xref:using-timefold-solver/running-the-solver.adoc#multithreadedSolving[multi-threaded solving] with most appenders,
285+
see below.
266286
267287
In Eclipse, `debug` logging to the console tends to cause congestion with move evaluation speeds above 10 000 per second.
268288
Nor IntelliJ, nor the Maven command line suffer from this problem.
@@ -371,7 +391,7 @@ logging.config.fileConfig('logging.conf')
371391
372392
[NOTE]
373393
====
374-
When running multiple solvers or a xref:enterprise-edition/enterprise-edition.adoc#multithreadedSolving[multi-threaded solver],
394+
When running multiple solvers or a xref:using-timefold-solver/running-the-solver.adoc#multithreadedSolving[multi-threaded solver],
375395
most appenders (including the console) cause congestion with `debug` and `trace` logging.
376396
Switch to an async appender to avoid this problem or turn off `debug` logging.
377397
====
@@ -645,7 +665,7 @@ For example, if set to `4`, submitting five problems
645665
has four problems solving immediately, and the fifth one starts when another one ends.
646666
If those problems solve for 5 minutes each, the fifth problem takes 10 minutes to finish.
647667
By default, `parallelSolverCount` is set to `AUTO`, which resolves to half the CPU cores,
648-
regardless of the xref:enterprise-edition/enterprise-edition.adoc#multithreadedSolving[`moveThreadCount`] of the solvers.
668+
regardless of the xref:enterprise-edition/enterprise-edition.adoc#enterpriseMultithreadedSolving[`moveThreadCount`] of the solvers.
649669
650670
To retrieve the best solution, after solving terminates normally, use `SolverJob.getFinalBestSolution()`:
651671

0 commit comments

Comments
 (0)