ticBytes
Start counting bytes transferred within parallel pool
Description
ticBytes starts
counting the number of bytes transferred by each worker in the current parallel
pool, so that later tocBytes can measure the amount of
data (and associated metadata) each worker transfers between the two calls. The
current parallel pool is the parallel.Pool object the gcp function with the
"noCreate" option returns. (since R2024a)
You must have a parallel pool running before you run the
ticBytes function.
If you call
ticByteswhen no parallel pool is running,ticBytesoperates on an empty pool with no workers and cannot count bytes transferred. In this case, when you calltocByteslater, MATLAB® returns an empty table.If you call
ticByteswhen no pool is running and then start a parallel pool,ticBytesdoes not operate on the newly created pool, because the pool did not exist when you calledticBytes. When you calltocByteslater, MATLAB returns an empty table.
The ticBytes and tocBytes functions
together help you track data movement between the client and workers during parallel
execution with functions like parfor,
spmd, and parfeval. Use these functions to
understand communication overhead and optimize your code.
ticBytes( starts counting the
number of bytes transferred by each worker in the parallel pool specified by the
pool)ProcessPool or ClusterPool object,
pool.
Use ticBytes(pool) and tocBytes(pool) calls
together when you want to measure data on a pool other than the pool the
gcp function returns.
and
startState = ticBytes
saves the state to a startState = ticBytes(pool)TicBytesResult object,
startState, so that you can simultaneously record the
number of bytes transferred for multiple pairs of ticBytes and
tocBytes calls. Use the value of
startState as an input argument for a subsequent call to
tocBytes.
Examples
Input Arguments
Output Arguments
Limitations
Thread-based pools do not support measuring bytes sent to or received from workers.