Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <solver_resources.h>
Public Member Functions | |
SolverResourcesProto | Proto () const |
Static Public Member Functions | |
static absl::StatusOr< SolverResources > | FromProto (const SolverResourcesProto &proto) |
Public Attributes | |
std::optional< double > | cpu |
std::optional< double > | ram |
The hints on the resources a remote solve is expected to use. These parameters are hints and may be ignored by the remote server (in particular in case of solve in a local subprocess, for example).
When using RemoteSolve() and RemoteComputeInfeasibleSubsystem(), these hints are mostly optional as some defaults will be computed based on the other parameters.
When using RemoteStreamingSolve() these hints are used to dimension the resources available during the execution of every action; thus it is recommended to set them.
Definition at line 41 of file solver_resources.h.
|
static |
Definition at line 37 of file solver_resources.cc.
SolverResourcesProto operations_research::math_opt::SolverResources::Proto | ( | ) | const |
Definition at line 26 of file solver_resources.cc.
std::optional<double> operations_research::math_opt::SolverResources::cpu |
The number of solver threads that are expected to actually execute in parallel. Must be finite and >0.0.
For example a value of 3.0 means that if the solver has 5 threads that can execute we expect at least 3 of these threads to be scheduled in parallel for any given time slice of the operating system scheduler.
A fractional value indicates that we don't expect the operating system to constantly schedule the solver's work. For example with 0.5 we would expect the solver's threads to be scheduled half the time.
This parameter is usually used in conjunction with SolveParameters.threads. For some solvers like Gurobi it makes sense to use SolverResources.cpu = SolveParameters.threads. For other solvers like CP-SAT, it may makes sense to use a value lower than the number of threads as not all threads may be ready to be scheduled at the same time. It is better to consult each solver documentation to set this parameter.
Definition at line 62 of file solver_resources.h.
std::optional<double> operations_research::math_opt::SolverResources::ram |
The limit of RAM for the solve in bytes. Must be finite and >=1.0 (even though it should in practice be much larger).
Definition at line 66 of file solver_resources.h.