hqs: Distributed Sort

View source: R/hqs.R

hqs,hqsTestR Documentation

Distributed Sort

Description

Sort a distributed vector.

Usage

hqs(cls,xname)
hqsTest(vlength,clength)

Arguments

cls

A cluster for the parallel package.

xname

Name of a distributed vector.

vlength

Length of the test vector.

clength

Size of the test cluster.

Details

In hqs, the distributed vector is sorted using the Hyperquicksort algorithm. In keeping with partools' Leave It There philosophy, both input and output are distributed; the sorted vector is NOT returned to the caller. The name of the sorted distributed vector will be chunk. If the caller needs the sorted vector, this can be obtained via distribcat.

Author(s)

Robin Yancey, Norm Matloff

Examples


cls <- makeCluster(4) 
setclsinfo(cls) 
z <- sample(1:50,25) 
z  # view unsorted vector 
distribsplit(cls,'z')  # distribute it
hqs(cls,'z') 
# view the distributed sorted vector
clusterEvalQ(cls,chunk) 
# optionally collect the results at the caller
distribcat(cls,'chunk')


matloff/partools documentation built on Oct. 20, 2022, 2:52 p.m.