load_balance: Load Balancing

Description Usage Arguments Details Author(s) Examples

Description

Re-distribute a shaq so that the data is "balanced" (in one of two ways; see Details section for more information). This can be useful when, for example, reading data onto multiple MPI ranks from a parallel file system, and then broadcasting/redistributing the data out to the other ranks.

Usage

1
2
3
4
5
6
7
balance.info(X.gbd, comm = 0, gbd.major = 1L, method = "llb")

.balance(X.gbd, bal.info = NULL, gbd.major = 1L)

unbalance(x, bal.info)

balance(x, method = "llb")

Arguments

X.gbd

A matrix.

comm

An MPI communicator number.

gbd.major

1 for row-major storage, 2 for column-major.

method

One of "llb" (locally load balanced) "bc" (block-cyclic).

bal.info

A returned object from balance.info().

x

A shaq.

Details

There are two separate interfaces. The functions balance() and unbalance() are the "high level" interface, and are appropriate for most use cases. However, for custom redistributions, the functions balance.info() and .balance() can be used. Use at your own risk.

balance() will rearrange the data distributed across the MPI ranks in one of two ways. The first is in a "locally load balanced" (llb) way. This means that each rank is given roughly the same amount of data. For example, balancing 6 rows across 4 MPI ranks would leave 2 rows on ranks 0 and 1 and 1 row on ranks 3 and 4. The other method of distribution is "block-cyclic" (bc). This will put the data into a 1-dimensional block-cyclic distribution so that the data could be handed off to pbdDMAT. See that package's documentation for more details.

Author(s)

Wei-Chen Chen and Drew Schmidt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# Run with 4 MPI ranks
suppressMessages(library(kazaam, quietly=TRUE))
comm.set.seed(1234, diff=TRUE)

n = sample(10, size=1)
d = matrix(comm.rank(), n, 3)

x = shaq(d)
x

y = balance(x)
y

finalize()

## End(Not run)

RBigData/pbdSHAQ documentation built on Nov. 9, 2021, 9:10 a.m.