Main Content

tall

Convert distributed array to equivalent tall array

Since R2023b

    Description

    T = tall(D) converts the distributed array D into a tall array. The underlying data type of T is the same as the underlying type of D.

    If the distribution of D is in the first dimension, then T has the same distribution. If the distribution of D is in any other dimension or uses a 2-D block-cyclic codistributor then T contains a redistribution of the underlying data in the first dimension.

    example

    Examples

    collapse all

    Create a distributed array, and then convert it into a tall array.

    First, create a distributed array directly on the workers and then convert it into the equivalent tall array.

    N = 1000;
    dX = distributed.colon(1,N)';
    Starting parallel pool (parpool) using the 'Processes' profile ...
    Connected to parallel pool with 6 workers.
    
    tX = tall(dX);

    Calculate the sum of the elements of the tall array and retrieve the value back to the local workspace.

    gather(sum(tX))
    Evaluating tall expression using the Parallel Pool 'Processes':
    Evaluation completed in 5.2 sec
    
    ans = 500500
    

    Input Arguments

    collapse all

    Distributed array to convert, specified as a distributed array stored in parts on the workers of the open parallel pool.

    Output Arguments

    collapse all

    Tall array defined in a parallel environment, returned as a tall array with the same underlying data type as the distributed array it was converted from.

    For information about how to work with tall arrays, see Lazy Evaluation of Tall Arrays.

    Version History

    Introduced in R2023b