Initevripct: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
===Purpose===
===Purpose===


Control initialization of PLS_Toolbox on Matlab worker instances in a parpool (Parallel Computing Toolbox).
Control the initialization of PLS_Toolbox on Matlab worker instances in a parpool (Parallel Computing Toolbox).
INITEVRIPCT is only relevant if PLS_Toolbox is used with the Mathworks Parallel Computing Toolbox.
INITEVRIPCT is only relevant if PLS_Toolbox is used with the Mathworks Parallel Computing Toolbox (PCT). It was introduced in PLS_Toolbox version 8.8.


===Synopsis===
===Synopsis===
Line 8: Line 8:


===Description===
===Description===
INITEVRIPCT is a PLS_Toolbox initialization. It runs a configuration function PREPEVRIIO on each parallel pool  
INITEVRIPCT is a PLS_Toolbox initialization function which should be called to start the PCT parallel pool. It runs a configuration function PREPEVRIIO on each parallel pool  
Matlab instance, if the Parallel Computing Toolbox (PCT) is installed. The PREPEVRIIO function controls the  
Matlab instance, if the PCT is installed. The PREPEVRIIO function controls the  
worker Matlab's access to the matlabprefs.mat file thereby avoiding problems if two workers try to access at the same time.
worker Matlabs' access to the matlabprefs.mat file thereby avoiding problems if two workers try to access that file at the same time.


In order to use PLS_Toolbox code with the Parallel Computing Toolbox you should  
In order to use PLS_Toolbox code with the Parallel Computing Toolbox you should  
Line 25: Line 25:


This function should be called before any PCT workers are used to execute PLS_Toolbox code.  
This function should be called before any PCT workers are used to execute PLS_Toolbox code.  
Please see the PLS_Toolbox function '''initevripctdemo.m''' which shows usage examples.


====Inputs====
====Inputs====

Latest revision as of 08:36, 20 July 2020

Purpose

Control the initialization of PLS_Toolbox on Matlab worker instances in a parpool (Parallel Computing Toolbox). INITEVRIPCT is only relevant if PLS_Toolbox is used with the Mathworks Parallel Computing Toolbox (PCT). It was introduced in PLS_Toolbox version 8.8.

Synopsis

hasgcp = initevripct(timeoutminutes);

Description

INITEVRIPCT is a PLS_Toolbox initialization function which should be called to start the PCT parallel pool. It runs a configuration function PREPEVRIIO on each parallel pool Matlab instance, if the PCT is installed. The PREPEVRIIO function controls the worker Matlabs' access to the matlabprefs.mat file thereby avoiding problems if two workers try to access that file at the same time.

In order to use PLS_Toolbox code with the Parallel Computing Toolbox you should

a) Shutdown the parpool if it is already running by:
 delete(gcp('nocreate'))
b) Run initevripct to start the pool and initialize PLS_Toolbox on each parpool Matlab:
 initevripct

This will avoid errors when parfor loops (or other parallel usage) using PLS_Toolbox code are first used. Insert a "initevripct" call before such calls to parfor. Once the worker pool has been initialized subsequent calls to initevripct take negligible execution time.

This function should be called before any PCT workers are used to execute PLS_Toolbox code.

Please see the PLS_Toolbox function initevripctdemo.m which shows usage examples.

Inputs

  • timeoutminutes = [{720}] positive integer value used for the parpool's idletimeout setting in minutes. Default = 12 hours.

Outputs

  • hasgcp = a boolean indicating whether the PCT parpool is available.

See Also