ActivityMonitorResults - Results from monitoring pool activity - MATLAB (original) (raw)

Main Content

Results from monitoring pool activity

Since R2025a

Description

An ActivityMonitorResults object contains the results from collecting pool activity monitoring data using a ActivityMonitor object. The ActivityMonitor object monitors and collects data on worker activity in a parallel pool.

Monitoring data includes:

You can retrieve the monitoring results using the results function and view the monitoring results data in the Pool Dashboard.

Creation

You can create an ActivityMonitorResults object in one of these ways:

Properties

expand all

This property is read-only.

Pool monitoring start time, represented as a datetime scalar.

Example: 18-Oct-2024 13:28:35

Data Types: datetime

This property is read-only.

Pool monitoring stop time, represented as a datetime scalar.

Example: 18-Oct-2024 16:00:05

Data Types: datetime

Examples

collapse all

Create an ActivityMonitor object to start collecting pool monitoring data. With default settings, parallel.pool.ActivityMonitor automatically starts an interactive parallel pool using the default profile if one does not exist.

monitor = parallel.pool.ActivityMonitor;

Create some large data on the client, then build a Constant object, C, transferring the data to the pool.

data = rand(1000); C = parallel.pool.Constant(data);

Run multiple parfor-loops accessing the data. For efficiency, preallocate the results array.

x = eye(5); for ii = 1:5 parfor jj = 1:20 x(ii,jj) = C.Value(ii,jj); end end

Stop the activity monitor and retrieve the ActivityMonitorResults object that contains the monitoring results collected during the execution of the parfor-loops.

monitoringResults = stop(monitor);

Visualize the monitoring results in the Pool Dashboard.

parpoolDashboard(monitoringResults)

The Pool Dashboard shows the execution timeline, list of constructs and their parent functions, and a summary of worker activity.

Version History

Introduced in R2025a