25.11.2015 Views

The MOSEK Python optimizer API manual Version 7.0 (Revision 141)

Optimizer API for Python - Documentation - Mosek

Optimizer API for Python - Documentation - Mosek

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

296 APPENDIX A. <strong>API</strong> REFERENCE<br />

Description:<br />

Solves several instances of the same problem in parallel, with unique parameter settings for each<br />

task. <strong>The</strong> argument task contains the problem to be solved. taskarray is a pointer to an array<br />

of num empty tasks. <strong>The</strong> task task and the num tasks pointed to by taskarray are solved in<br />

parallel. That is num + 1 threads are started with one <strong>optimizer</strong> in each. Each of the tasks can<br />

be initialized with different parameters, e.g different selection of solver.<br />

All the concurrently running tasks are stopped when the <strong>optimizer</strong> successfully terminates for<br />

one of the tasks. After the function returns task contains the solution found by the task that<br />

finished first.<br />

After Task.optimizeconcurrent returns task holds the optimal solution of the task which<br />

finished first. If all the concurrent optimizations finished without providing an optimal solution<br />

the error code from the solution of the task task is returned.<br />

In summary a call to Task.optimizeconcurrent does the following:<br />

• All data except task parameters (iparam, dparam and sparam) in task is copied to each of<br />

the tasks in taskarray. In particular this means that any solution in task is copied to the<br />

other tasks. Call-back functions are not copied.<br />

• <strong>The</strong> tasks task and the num tasks in taskarray are started in parallel.<br />

• When a task finishes providing an optimal solution (or a certificate of infeasibility) its<br />

solution is copied to task and all other tasks are stopped.<br />

Observe the concurrent <strong>optimizer</strong> is not deterministic.<br />

For an explained code example see Section 11.6.4.<br />

A.2.169<br />

Task.<strong>optimizer</strong>summary()<br />

Task.<strong>optimizer</strong>summary(whichstream)<br />

Prints a short summary with <strong>optimizer</strong> statistics for last optimization.<br />

Arguments<br />

whichstream :<br />

streamtype<br />

Index of the stream.<br />

Description:<br />

Prints a short summary with <strong>optimizer</strong> statistics for last optimization.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!