Initevripct

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search

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