Products & Services Solutions Academia Support User Community Company

Learn more about Genetic Algorithm and Direct Search Toolbox   

Parallel Computing with Pattern Search

Parallel Pattern Search

Parallel computing is the technique of using multiple processes or processors on a single problem. The reason to use parallel computing is to speed up computations.

If enabled for parallel computation, the Genetic Algorithm and Direct Search Toolbox solver patternsearch automatically distributes the evaluation of objective and constraint functions associated with the points in a pattern to multiple processes or processors. patternsearch uses parallel computing under the following conditions:

When these conditions hold, the solver computes the objective function and constraint values of the pattern search in parallel during a poll.

Using Parallel Computing with patternsearch

Using Parallel Computing with Multicore Processors

If you have a multicore processor, you might see speedup using parallel processing. You can establish a matlabpool of several parallel workers with a Parallel Computing Toolbox license. For a description of Parallel Computing Toolbox software, and the maximum number of parallel workers, see Product Overview.

Suppose you have a dual-core processor, and wish to use parallel computing:

When you run an applicable solver with options, applicable solvers automatically use parallel computing.

To stop computing optimizations in parallel, set UseParallel to 'never', or set the Optimization Tool not to compute in parallel. To halt all parallel computation, enter

matlabpool close

Using Parallel Computing with a Multiprocessor Network

If you have multiple processors on a network, use Parallel Computing Toolbox functions and MATLAB® Distributed Computing Server™ software to establish parallel computation. Here are the steps to take:

  1. Make sure your system is configured properly for parallel computing. Check with your systems administrator, or refer to the Parallel Computing Toolbox documentation, or MATLAB Distributed Computing Server System Administrator's Guide.

    To perform a basic check:

    1. At the command line enter

      matlabpool open conf

      or

      matlabpool open conf n

      where conf is your configuration, and n is the number of processors you wish to use.

    2. If network_file_path is the network path to your objective or constraint functions, enter

      pctRunOnAll('addpath network_file_path')

      so the worker processors can access your objective or constraint M-files.

    3. Check whether an M-file is on the path of every worker by entering

      pctRunOnAll('which filename')

      If any worker does not have a path to the M-file, it reports

      filename not found.
    • For command-line use, enter

      options = psoptimset('UseParallel','always');
    • For Optimization Tool, set Options > User function evaluation > Evaluate fitness and constraint functions > in parallel.

Once your parallel computing environment is established, applicable solvers automatically use parallel computing whenever called with options.

To stop computing optimizations in parallel, set UseParallel to 'never', or set the Optimization Tool not to compute in parallel. To halt all parallel computation, enter

matlabpool close

Parallel Search Function

patternsearch can optionally call a search function at each iteration. The search is done in parallel under the following conditions:

Implementation Issues in Parallel Pattern Search

Pattern search is implemented in the patternsearch solver by using the Parallel Computing Toolbox function parfor. parfor distributes the evaluation of objective and constraint functions among multiple processes or processors.

The limitations on options, listed in Parallel Pattern Search, arise partly from the limitations of parfor, and partly from the nature of parallel processing:

More caveats related to parfor are listed in the Limitations section of the Parallel Computing Toolbox documentation.

Parallel Computing Considerations

The Improving Performance with Parallel Computing section of the Optimization Toolbox documentation contains information on factors that affect the speed of parallel computations, factors that affect the results of parallel computations, and searching for global optima. Those considerations also apply to parallel computing with pattern search.

Additionally, there are considerations having to do with random numbers that apply to Genetic Algorithm and Direct Search Toolbox functions. Random number sequences in MATLAB are pseudorandom, determined from a "seed," an initial setting. Parallel computations use seeds that are not necessarily controllable or reproducible. For example, there is a default global setting on each instance of MATLAB that determines the current seed for random sequences.

Parallel pattern search does not have reproducible polls when used with MADS, and does not have reproducible searches with MADS, the genetic algorithm, or Latin hypercube search methods.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS