FRAMES NO FRAMES

Class IloParallelSolver

Definition file: ilsolver/ilopsolver.h
Include file: <ilsolver/ilosolver.h>

IloParallelSolver creates multiple instances of the search engine, one in each thread, sharing the same search tree. Each of these instances is an instance of IloSolver and the instances are known as workers or agents. They communicate with each other across a virtual communication layer to carry out load balancing, propagation of bounds to reduce the search tree, and detection of termination (either because a solution has been found or because there is no further search to do).

See Also:

Constructor Summary
public IloParallelSolver(IloParallelSolverI * impl=0)
public IloParallelSolver(const IloEnv & env, IloInt numberOfWorkers, IloInt=-1, IloBool trace=IlcFalse)
public IloParallelSolver(const IloModel & model, IloInt numberOfWorkers, IloInt=-1, IloBool trace=IlcFalse)
Method Summary
public IloBoolconcurrentSolve(IloArray< IloGoal > goals, IloBool wait, IloGoal last=0)
public IloParallelSolverI *getImpl() const
public IloIntgetSuccessfulWorkerId() const
public IloSolvergetWorker(IloInt id) const
public voidsetFileNodeOptions(IlcInt maxSize, char * prefixName, IlcBool useCompression, IlcBool useDisk) const
public voidsetTimeLimit(IloNum limit) const
public voidsetTrace(IloBool trace) const
public IloBoolsolve(IloGoal goal) const
public IloBoolsolve() const
public voidunsetLimit() const
Inherited Methods from IloAlgorithm
clear, end, error, extract, getEnv, getIntValue, getIntValues, getModel, getObjValue, getStatus, getTime, getValue, getValue, getValue, getValue, getValues, getValues, isExtracted, out, printTime, resetTime, setError, setOut, setWarning, solve, warning
Constructor Detail

IloParallelSolver

public IloParallelSolver(IloParallelSolverI * impl=0)

This constructor creates an algorithm for IBM® ILOG® Solver.


IloParallelSolver

public IloParallelSolver(const IloEnv & env, IloInt numberOfWorkers, IloInt=-1, IloBool trace=IlcFalse)

This constructor creates an algorithm for IBM ILOG Solver. The parameter numberOfWorkers is used to configure load balancing.


IloParallelSolver

public IloParallelSolver(const IloModel & model, IloInt numberOfWorkers, IloInt=-1, IloBool trace=IlcFalse)

This constructor creates an algorithm for IBM ILOG Solver. The parameter numberOfWorkers is used to configure load balancing.


Method Detail

concurrentSolve

public IloBool concurrentSolve(IloArray< IloGoal > goals, IloBool wait, IloGoal last=0)

This member function solves a problem by using the array of goals goal passed as a parameter. It solves the same model using different goals. The number of goals must be greater than or equal to the number of workers. A number of workers n will use the first n elements of the array of goals.

If there is an objective, there is cooperation among the workers. When a worker finds a new feasible solution, the bound information is propagated to the other workers. If there is no objective, there is no cooperation among the workers.

If the parameter wait is IloTrue, concurrentSolve will wait for all workers to finish before suceeding and returning IloTrue. If the parameter wait is IloFalse, concurrentSolve will succeed and return IloTrue when the first worker finishes.

The third parameter last is an IloGoal that is called by the first worker to finish. This last goal is executed after exiting from the concurrent part of the search. The parameter last is optional.


getImpl

public IloParallelSolverI * getImpl() const

This member function returns a pointer to the implementation object corresponding to the invoking parallel solver.


getSuccessfulWorkerId

public IloInt getSuccessfulWorkerId() const

This member function returns a positive integer identifying a successful worker (an instance of IloInt). These identifying numbers start from 0 (zero) and are contiguous. This function can only be used after a successful IloParallelSolver::solve.


getWorker

public IloSolver getWorker(IloInt id) const

This member function returns the solver of the worker by identifying number.


setFileNodeOptions

public void setFileNodeOptions(IlcInt maxSize, char * prefixName, IlcBool useCompression, IlcBool useDisk) const

Node files make it possible for you to limit the amount of memory Solver uses to store open search nodes. (Open search nodes in the search are the ones which have not yet been completely explored.) You activate node files by invoking this member function. This member function sets the options for node files and must be used before starting a search.

When the memory used to store nodes is greater than maxSize bytes, Solver creates a buffer of one megabyte. Solver then fills that buffer with open nodes. The parameter maxSize cannot be less than 5 000 000. If the given parameter is less than 5 000 000, Solver will silently change it to 5 000 000.

If the parameter useCompression is set to IlcTrue, the buffer is compressed. If the parameter useDisk is set to IlcTrue, this temporary buffer is then flushed from memory and written to disk as a file. The name of the file is prefixed by prefixName.

If one buffer is not enough to reduce the memory consumption below maxSize, then Solver creates node files until the memory consumption fits that limit.


setTimeLimit

public void setTimeLimit(IloNum limit) const

This member function sets a limit on the amount of time spent during a search by IloParallelSolver::solve.

The limit is set to the current time plus time. The limit is recomputed whenever this member function is called. When the limit is reached, the search stops and the current call to the member function IloParallelSolver returns IlcFalse.

On most platforms, the time is measured in elapsed cpu seconds for the search process; on personal computers with Windows, the time is merely elapsed wall-clock time.

This change will influence any subsequent calls of the member function IloParallelSolver::solve.


setTrace

public void setTrace(IloBool trace) const

This member function takes a Boolean value as its argument. If this argument is IlcTrue, it activates the trace functions of Parallel Solver. If the argument is IlcFalse, it inhibits the trace functions.


solve

public IloBool solve(IloGoal goal) const

This member function solves a problem by using the goal passed as a parameter.

The synchronize mode is fixed to be IloSynchronizeAndRestart.


solve

public IloBool solve() const

This member function solves a problem by using a default goal to launch the search.

This member function first checks to see whether a model has already been extracted. If a model has already been extracted, it then checks whether the model has changed since it was extracted previously. If the model has changed, then the model is extracted again. If the model has not changed, then it is not extracted again. In other words, this member function synchronizes with the current model before it starts its search.

When Concert Technology determines at extraction time that the model is infeasible, it skips the remainder of the extraction, and the first call to the member function solve will report without any search that there is no solution.


unsetLimit

public void unsetLimit() const

This member function removes any limits, such as a time limit, a limit on the number of choice points, or a limit on the number of failures, for the invoking solver. This change will influence any subsequent calls of the member functions IloParallelSolver::solve.