Definition of the Matlab license manager.
This module contains the
which enables to check the presence of any toolbox licenses
of the Matlab installation.
- class gemseo.wrappers.matlab.license_manager.LicenseManager(engine)¶
Manage Matlab License.
The licenseManager was created to enables de-synchronised launch of optimization using matlab_discipline. The goal is to wait until all licenses that are needed are available in Matlab workspace. Parallel computing launch can be used with this tool.
>>> # Build a new matlab engine >>> eng = get_matlab_engine() >>> # add a toolbox to the engine >>> eng.add_toolbox("signal_toolbox") >>> # build a license manager from the previous engine >>> lm = LicenseManager(eng) >>> # check licenses of the engine until all are available >>> lm.check_licenses()
engine (gemseo.wrappers.matlab.engine.MatlabEngine) – The MatlabEngine instance.
- Return type
- check_licenses(licenses=None, pause_frac=60, pause_const=20)¶
Check that the Matlab licenses exist.
The method fetches all the needed licenses thanks to the matlab function licenseControl and the class Logger. Note that the MATLAB function will be looping until the given toolboxes are available.
The list of matlab toolboxes. If
None, use the already existing engine licenses.
By default it is set to None.
pause_frac (float) –
The time used between each try to get licenses.
By default it is set to 60.
pause_const (float) –
The time added in order to estimate the waiting time. The waiting time is estimated at each try with the following formula:
Wt = pause_const + random([0,1])*pause_frac.
By default it is set to 20.
- Return type
- start_parallel_computing(n_parallel_workers=4, cluster_name='local')¶
Start parallel computing in MatlabEngine.
- CURVE_FIT_TOOL = 'Curve_Fitting_Toolbox'¶
- DISTRIB_COMP_TOOL = 'distrib_computing_toolbox'¶
- SIGNAL_TOOL = 'signal_toolbox'¶
- property licenses¶