Improved

schemes

for

mapping

arbitrary

algorithms

onto

processor

meshes

Borut

Robi

c

a

Bo

stjan

Vilfan

b

a

Computer

Systems

Department

Jo

zef

Stefan

Institute

Jamova

Ljubljana

Slovenia

email

borut.robic@ijs.si

b

Faculty

of

Electrical

Engineering

and

Computer

Science

University

of

Ljubljana

Tr

za

ska

Ljubljana

Slovenia

Technical

Report

March

Improved

schemes

for

mapping

arbitrary

algorithms

onto

processor

meshes

Borut

Robi

c

a

Bo

stjan

Vilfan

b

a

Computer

Systems

Department

Jo

zef

Stefan

Institute

Jamova

Ljubljana

Slovenia

email

borut.robic@ijs.si

b

Faculty

of

Electrical

Engineering

and

Computer

Science

University

of

Ljubljana

Tr

za

ska

Ljubljana

Slovenia

Abstract

We

address

the

problem

of

efficient

schemes

for

mapping

arbitrary

parallel

algorithms

onto

distributed

memory

message

passing

multiprocessors

with

mesh

topologies

We

analyze

a

particular

mapping

scheme

find

the

reasons

for

its

low

efficiency

and

show

that

mapped

algorithms

tend

to

be

both

wider

and

higher

than

necessary

As

a

result

they

generally

execute

too

slow

while

at

the

same

time

occupying

an

excessive

number

of

processors

Two

approaches

to

the

improvement

of

the

scheme

are

presented

one

direct

and

the

other

indirect

In

the

direct

approach

we

describe

four

nontrivial

improvements

of

the

scheme

but

also

prove

their

NP-completeness

In

contrast

in

the

indirect

approach

the

original

scheme

is

followed

by

a

refinement

procedure

that

incrementally

improves

the

mapped

algorithms

We

describe

four

different

heuristic

refinement

procedures

Experimental

results

show

that

the

indirect

approach

offers

a

saving

in

processor

resources

and

at

the

same

time

a

saving

in

execution

time

on

average

This

work

has

been

supported

by

Ministry

of

Science

and

Technology

of

the

Republic

of

Slovenia

under

Grant

Number

Technical

Report

March

Introduction

The

performance

of

a

multiprocessor

strongly

depends

on

the

mapping

of

the

algorithm

onto

the

underlying

machine

i.e.

on

the

way

that

the

computation

is

organized

on

a

network

of

processors

One

can

say

that

Performance

Algorithm

Machine

modulo

Mapping

The

mapping

in

turn

depends

on

the

characteristics

of

the

algorithm

and

the

machine

So

in

order

to

construct

the

best

possible

mapping

which

optimizes

system

performance

basic

features

of

both

the

algorithm

and

the

machine

must

be

considered

To

do

this

several

graph-based

mathematical

models

for

the

mapping

problem

have

been

proposed

-LSB-

-RSB-

They

represent

the

multiprocessor

by

an

undirected

network

graph

Gn

-LRB-

Vn

En

-RRB-

where

Vn

and

En

are

the

sets

of

processors

and

interconnection

links

respectively

These

models

also

assume

that

given

some

problem

a

set

of

interactive

sequential

tasks

has

been

constructed

to

solve

the

problem

This

set

gives

rise

in

a

natural

way

to

a

problem

graph

Gp

-LRB-

Vp

Ap

-RRB-

where

Vp

is

the

set

of

tasks

and

Ap

is

the

set

of

arcs

representing

interactions

between

the

tasks

Then

the

mapping

becomes

a

function

Vp

Vn

As

noted

it

is

desirable

that

models

also

reflect

basic

features

of

the

target

architecture

Nonuniformity

of

the

communication

cost

is

such

a

feature

describing

the

fact

that

the

cost

to

transport

a

message

depends

on

the

locations

of

the

sending

and

the

receiving

processor

The

reason

is

that

Gn

is

not

completely

connected

so

the

messages

must

often

travel

through

several

links

and

intermediate

processors

Next

when

many-to-one

mappings

are

allowed

models

may

also

take

into

account

that

fair

mapping

usually

implies

faster

execution

Here

fairness

of

the

mapping

is

usually

measured

by

the

degree

of

processor

load

balance

Another

important

but

somewhat

hard-to-model

feature

of

multiprocessors

concerns

network

bottlenecks

that

is

communication-channel

contention

which

is

reflected

in

additional

communication

delays

These

features

are

incorporated

into

models

in

terms

of

objective

functions

which

are

to

be

optimized

by

some

mapping

Many

objective

functions

have

been

defined

using

communication

cost

-LSB-

-RSB-

load

balance

-LSB-

-RSB-

channel

contention

or

some

combination

of

these

-LSB-

-RSB-

This

gave

rise

to

a

variety

of

optimization

problems

of

the

type

Given

a

problem

graph

Gp

and

a

network

graph

Gn

find

a

mapping

that

satisfies

a

criterion

C

where

C

involves

the

optimization

of

a

particular

objective

function

while

perhaps

satisfying

some

additional

constraints

Unfortunately

many

of

these

optimization

problems

turn

out

to

be

NP-complete

even

for

the

simplest

objective

functions

and

are

thus

computationally

intractable

for

graphs

of

any

significant

size

-LSB-

-RSB-

Hence

it

is

essential

to

use

heuristic

methods

to

determine

satisfactory

suboptimal

mappings

Several

methods

of

this

kind

have

been

devised

some

being

inspired

even

by

the

natural

sciences

-LRB-

e.g.

genetic

algorithms

neural

networks

and

simulated

annealing

-LSB-

-RSB-

-RRB-

In

addition

approaches

have

been

explored

to

discover

suitable

mappings

for

particular

kinds

of

problem

graphs

-LSB-

-RSB-

and/or

network

graphs

-LSB-

-RSB-

Among

the

latter

meshes

-LRB-

i.e.

architectures

with

regular

topology

-RRB-

have

attracted

considerable

interest

In

this

case

each

internal

processor

has

degree

r

for

some

fixed

r

-LRB-

with

no

consensus

on

what

to

do

with

boundary

processors

-RRB-

The

interest

in

meshes

is

partly

based

upon

recent

developments

in

VLSI

technology

that

have

made

it

possible

to

build

relatively

large

cheap

and

scalable

processing

arrays

with

regular

topology

in

a

single

chip

Apart

from

that

these

architectures

are

also

interesting

because

they

have

proved

to

be

efficient

in

the

execution

of

some

important

classes

of

algorithms

such

as

matrix

algorithms

Members

of

these

classes

usually

exhibit

a

high-degree

of

internal

regularity

that

can

be

efficiently

exploited

by

the

regular

topology

of

the

mesh

architectures

For

instance

systolic

and

wavefront

VLSI

arrays

have

proved

to

be

efficient

in

the

execution

of

decision-free

algorithms

that

are

characterized

by

having

a

dataflow

pattern

and

computational

order

independent

of

the

data

values

Consequently

several

schemes

for

the

mapping

of

certain

classes

of

computational

algorithms

onto

architectures

with

regular

topology

have

been

proposed

-LSB-

-RSB-

In

this

paper

we

view

the

problem

in

a

more

general

setting

We

are

interested

in

a

graph-based

mapping

scheme

that

is

applicable

to

arbitrary

algorithms

We

do

not

therefore

impose

any

restrictions

on

the

problem

graph

Gp

In

particular

Gp

can

be

cyclic

We

do

assume

however

that

the

target

architecture

has

regular

topology

is

homogeneous

-LRB-

i.e.

all

the

processors

are

identical

-RRB-

and

has

congestion

equal

to

-LRB-

i.e.

a

link

is

assigned

to

at

most

one

pair

of

communicating

tasks

-RRB-

Furthermore

we

only

address

the

problem

of

one-to-one

mapping

assuming

that

in

the

case

of

manyto-one

mapping

computational

load

balancing

has

previously

been

accomplished

producing

supernodes

-LRB-

i.e.

partitions

of

Vp

-RRB-

by

any

one

of

several

known

heuristic

partitioning

techniques

-LSB-

-RSB-

This

is

in

accordance

with

-LSB-

-RSB-

where

it

is

shown

that

the

mapping

problem

can

be

broken

into

partitioning

and

assignment

problem

with

the

latter

being

more

important

in

point-to-point

distributed

architectures

Finally

we

are

going

to

restrict

ourselves

to

static

mappings

That

is

to

say

we

assume

that

the

structure

of

the

interprocess

interactions

of

the

parallel

program

is

characterizable

at

compile

time

so

that

the

mapping

analysis

only

needs

to

be

done

once

The

outline

of

the

paper

is

as

follows

In

Section

we

introduce

notation

and

terminology

Section

reviews

a

mapping

scheme

from

-LSB-

-RSB-

that

can

be

used

to

map

arbitrary

algorithms

expressed

in

terms

of

program

graphs

onto

parallel

computer

architecture

with

regular

topology

Section

analyzes

the

scheme

and

shows

that

the

mapped

algorithms

generally

exhibit

serious

drawbacks

such

as

slow

execution

while

at

the

same

time

occupying

an

excessive

area

In

Section

we

describe

four

nontrivial

improvements

of

the

scheme

however

we

also

prove

their

NP-completeness

In

contrast

in

Section

we

consider

the

possibility

to

refine

the

results

of

the

original

mapping

scheme

and

present

four

heuristic

refinement

procedures

Section

presents

experimental

results

showing

that

the

latter

approach

offers

a

saving

in

processor

resources

and

at

the

same

time

a

saving

in

execution

time

on

average

In

Section

we

present

some

concluding

remarks

Preliminaries

Some

terminology

and

notation

that

is

used

throughout

the

paper

is

collected

in

this

section

for

convenience

Let

Gp

-LRB-

Vp

Ap

-RRB-

denote

the

problem

graph

where

Vp

represents

the

set

of

tasks

while

the

set

of

directed

arcs

Ap

represents

data

dependencies

between

the

tasks

The

multiprocessor

is

modelled

by

an

undirected

network

graph

Gn

-LRB-

Vn

En

-RRB-

with

Vn

and

En

representing

sets

of

processors

and

interconnection

links

respectively

When

the

degree

of

each

internal

processor

equals

to

r

for

some

fixed

r

we

refer

to

such

a

Gn

as

the

r-mesh

The

regularity

of

r-meshes

makes

it

easy

to

arrange

processors

into

rows

and

columns

when

embedded

in

the

plane

-LRB-

Fig.

-RRB-

r

r

r

r

Fig.

Details

from

r-meshes

of

degree

r

and

Generally

a

path

between

two

vertices

of

a

graph

is

any

succession

of

vertices

starting

from

the

first

vertex

and

ending

at

the

second

in

which

every

two

successive

vertices

are

joined

by

an

arc

and

no

vertex

is

repeated

The

length

of

a

path

-RCB-

is

the

number

of

arcs

along

it

and

is

denoted

by

j

-RCB-

j

In

particular

a

path

in

Gn

will

be

referred

to

as

a

routing

path

Let

P

aths

denote

the

set

of

all

routing

paths

in

Gn

Then

a

mapping

-LRB-

ss

ae

-RRB-

of

Gp

into

Gn

is

a

one-to-one

function

ss

Vp

Vn

along

with

a

function

ae

Ap

P

aths

that

maps

an

arc

-LRB-

u

v

-RRB-

Ap

to

a

routing

path

between

processors

ss

-LRB-

u

-RRB-

and

ss

-LRB-

v

-RRB-

We

denote

this

path

simply

by

ae

-LRB-

u

v

-RRB-

The

image

-LRB-

Gp

-RRB-

is

called

the

configuration

of

Gp

Say

Gn

has

congestion

k

if

a

link

can

be

shared

by

at

most

k

routing

paths

Let

columns

-LRB-

rows

-RRB-

of

Gn

when

embedded

in

the

plane

as

in

Fig.

be

enumerated

in

ascending

order

from

left

to

right

-LRB-

from

top

to

bottom

-RRB-

For

each

task

u

let

col

-LRB-

u

-RRB-

resp

row

-LRB-

u

-RRB-

denote

the

index

of

the

column

resp

row

where

the

host

processor

ss

-LRB-

u

-RRB-

resides

i.e.

where

u

is

mapped

by

Then

the

column

distance

between

two

mapped

tasks

u

and

v

is

jcol

-LRB-

u

-RRB-

col

-LRB-

v

-RRB-

j.

Likewise

their

row

distance

is

jrow

-LRB-

u

-RRB-

row

-LRB-

v

-RRB-

j.

Define

the

dilation

dil

-LRB-

u

v

-RRB-

of

an

arc

-LRB-

u

v

-RRB-

Ap

as

the

number

of

intermediate

processors

along

the

routing

path

ae

-LRB-

u

v

-RRB-

i.e.

dil

-LRB-

u

v

-RRB-

jae

-LRB-

u

v

-RRB-

j

We

denote

the

neighborhood

of

a

task

u

i.e.

the

set

of

all

tasks

adjacent

to

u

in

the

problem

graph

Gp

by

N

-LRB-

u

-RRB-

Finally

the

set

of

nonnegative

integers

is

denoted

by

Z

A

mapping

scheme

Let

Gp

-LRB-

Vp

Ap

-RRB-

be

a

problem

graph

The

basic

mapping

scheme

is

denoted

by

-LRB-

-RRB-

and

consists

of

three

steps

referred

to

as

layer

construction

placement

of

the

layers

and

path

construction

-LSB-

-RSB-

The

scheme

takes

into

account

that

the

congestion

of

Gn

is

-RRB-

Layer

construction

During

the

first

step

of

the

set

of

tasks

is

partitioned

into

layers

Li

i

That

is

Vp

Si

Li

where

Li

Lj

for

i

j.

To

do

this

an

acyclic

subgraph

-LRB-

V

p

-RRB-

of

Gp

is

first

constructed

by

deleting

superfluous

arcs

from

Gp

i.e.

V

p

Vp

and

Ap

The

construction

is

carried

out

by

a

depth-first

traversal

of

Gp

during

which

backward

arcs

-LRB-

i.e.

arcs

closing

loops

-RRB-

are

detected

and

deleted

Since

is

acyclic

for

each

v

V

p

the

length

of

the

longest

path

starting

from

any

input

task

and

ending

at

v

is

well-defined

and

denoted

by

-LRB-

v

-RRB-

Call

-LRB-

v

-RRB-

the

level

of

v.

Layers

can

now

be

defined

as

Li

fv

V

p

j

-LRB-

v

-RRB-

ig

for

i

To

construct

them

is

submitted

to

a

variant

of

the

topological

sort

which

in

each

iteration

constructs

the

next

Li

from

all

the

tasks

currently

having

input

degree

and

then

deletes

these

tasks

together

with

their

output

arcs

from

the

current

subgraph

-LRB-

Fig.

-RRB-

a

-RRB-

i

while

do

Li

fu

indeg

-LRB-

u

-RRB-

g

Li

i

i

end

b

-RRB-

j

j

j

j

j

j

j

j

j

R

R

HHHHj

ss

HHHHj

ss

Fig.

a

-RRB-

Algorithm

for

topological

sorting

of

b

-RRB-

An

example

-RRB-

Placement

of

layers

This

step

consists

of

two

parts

First

in

the

initial

placement

each

Li

is

placed

on

the

i-th

row

of

Gn

using

an

arbitrary

initial

assignment

of

tasks

to

the

processors

on

the

row

Second

in

the

permutation

process

the

mapped

tasks

are

arranged

within

each

row

in

such

a

way

that

the

routing

paths

which

still

remain

to

be

built

in

the

last

step

of

are

expected

to

be

short

The

idea

is

to

arrange

each

pair

of

communicating

tasks

u

and

v

as

much

as

possible

one

under

the

other

thus

allowing

the

routing

path

-LRB-

u

v

-RRB-

to

be

as

vertical

as

possible

Informally

the

arrangement

is

constructed

by

the

repeated

application

of

a

heuristic

that

places

a

task

u

in

a

column

-LRB-

within

the

same

row

-RRB-

as

close

as

possible

to

the

center

of

mass

for

all

the

routing

paths

started

or

ended

by

u

More

precisely

the

heuristic

moves

u

from

the

initially

assigned

column

-LRB-

u

-RRB-

as

close

as

possible

to

the

column

col

-LRB-

u

-RRB-

jN

-LRB-

u

-RRB-

j

P

-LRB-

u

-RRB-

-LRB-

v

-RRB-

The

heuristic

is

repeatedly

applied

until

there

is

no

change

in

the

arrangement

of

tasks

-RRB-

Path

construction

The

final

step

of

determines

how

each

arc

-LRB-

u

v

-RRB-

of

the

problem

graph

Gp

is

to

be

represented

by

a

routing

path

-LRB-

u

v

-RRB-

in

the

network

graph

Gn

The

routing

paths

are

built

in

a

heuristic

piecemeal

fashion

moving

from

one

processor

of

Gn

to

another

At

each

processor

a

single

link

is

added

to

one

or

more

incomplete

routing

paths

that

go

through

it

The

processing

of

the

incomplete

paths

is

performed

according

to

their

dynamically

assigned

priorities

This

makes

it

possible

to

choose

a

suitable

routing

heuristic

However

since

the

congestion

is

bottleneck

situations

still

develop

where

too

many

routing

paths

have

to

be

routed

through

a

small

area

on

Gn

In

such

cases

only

the

last

decision

in

the

routing

process

is

changed

instead

of

performing

an

extensive

backtracking

to

search

for

other

routings

If

this

does

not

solve

the

problem

a

row

or

column

of

vertices

is

simply

inserted

into

Gn

Example

Fig.

shows

an

example

of

a

problem

graph

GNewton

associated

with

the

problem

of

computing

the

square

root

pc

by

Newton

's

method

-LRB-

Fig.

-RRB-

The

tasks

of

GNewton

are

labeled

simply

by

consecutive

integers

since

the

meaning

of

the

tasks

is

irrelevant

for

the

mapping

Fig.

shows

of

GNewton

on

a

a

-RRB-

repeat

xn

-LRB-

xn

cxn

-RRB-

until

jxn

xnj

ffi

b

-RRB-

ffifl

ffl

ffifl

ffl

ffifl

fflfi

ffifl

fflfi

ffifl

ffl

ffifl

fflfi

ffifl

ffl

ffifl

ffl

ffifl

fflfi

ffifl

ffl

ffifl

fflfi

ffifl

ffl

ffifl

fflfi

ffifl

ffl

ffifl

fflfi

ffifl

fflfi

oe

QQQs

QQQs

QQQs

oe

HHHHj

oe

HHHHj

oe

c

-RRB-

HH

oe

Fig.

a

-RRB-

Program

for

square

root

by

Newton

's

method

b

-RRB-

Problem

graph

c

-RRB-

Analysis

of

the

scheme

This

section

is

concerned

with

general

properties

of

For

the

sake

of

motivation

let

us

consider

again

the

example

in

Fig.

Though

there

are

only

tasks

in

GNewton

its

uses

as

much

as

processors

Clearly

the

extra

processors

are

only

engaged

in

establishing

routing

paths

Yet

one

can

do

much

better

than

this

Fig.

shows

a

configuration

of

GNewton

for

some

mapping

that

uses

no

extra

processors

oe

oe

Fig.

A

configuration

of

GNewton

with

no

extra

processors

We

shall

shortly

show

that

generally

exhibit

such

undesirable

features

In

particular

we

will

show

that

tend

to

be

both

higher

and

wider

than

necessary

To

see

this

we

prove

that

row

and

column

distances

between

some

communicating

tasks

may

become

very

large

Since

-LRB-

u

v

-RRB-

j

is

bounded

below

by

both

row

and

column

distance

between

u

and

v

this

also

proves

that

may

stretch

arcs

into

long

routing

paths

Vertical

stretching

Recall

that

the

first

step

of

constructs

an

acyclic

subgraph

of

Gp

in

order

to

be

able

to

associate

a

level

-LRB-

v

-RRB-

to

each

task

v.

To

construct

depth-first

traversal

of

Gp

is

performed

during

which

backward

arcs

-LRB-

i.e.

arcs

closing

loops

-RRB-

are

detected

and

deleted

Nevertheless

each

of

the

deleted

arcs

must

eventually

be

represented

by

a

routing

path

in

Gn

In

what

follows

we

show

that

deleted

arcs

may

stretch

into

long

routing

paths

Notice

first

that

depth-first

traversal

deletes

-LRB-

u

v

-RRB-

if

-LRB-

u

v

-RRB-

would

otherwise

close

some

traversed

path

-RCB-

-LRB-

v

u

-RRB-

starting

from

v

and

ending

at

u

into

a

cycle

Such

a

cycle

will

be

referred

to

as

the

traversed

cycle

So

let

-LRB-

u

v

-RRB-

be

a

deleted

backward

arc

The

following

lemma

establishes

a

lower

bound

on

the

difference

between

-LRB-

u

-RRB-

and

-LRB-

v

-RRB-

Lemma

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

j

-RCB-

-LRB-

v

u

-RRB-

j

Proof

The

tasks

along

the

path

-RCB-

-LRB-

v

u

-RRB-

receive

their

levels

in

strictly

increasing

order

-LRB-

cf.

algorithm

in

Fig.

-RRB-

Recall

that

the

first

step

of

places

u

and

v

on

-LRB-

u

-RRB-

th

and

-LRB-

v

-RRB-

th

row

of

Gn

respectively

making

the

initial

row

distance

between

the

tasks

to

be

jrow

-LRB-

u

-RRB-

row

-LRB-

v

-RRB-

j

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j.

Therefore

lemma

also

establishes

a

lower

bound

on

the

initial

row

distance

between

tasks

u

and

v

of

a

deleted

arc

-LRB-

u

v

-RRB-

and

a

fortiori

on

the

length

of

the

routing

path

-LRB-

u

v

-RRB-

Thus

if

the

traversed

cycle

is

long

so

is

the

routing

path

representing

the

deleted

arc

The

converse

of

this

is

false

however

That

is

to

say

even

though

the

traversed

cycle

is

short

the

deleted

arc

may

stretch

into

a

long

routing

path

This

is

due

to

the

fact

that

deleting

an

arc

may

also

cut

other

cycles

that

may

still

exist

in

the

unvisited

part

of

the

graph

Formally

let

be

the

family

of

all

cycles

having

in

common

the

arc

-LRB-

u

v

-RRB-

that

is

being

deleted

For

each

i

I

let

-RCB-

i

-LRB-

v

u

-RRB-

denote

the

path

resulting

from

Ci

after

deletion

of

-LRB-

u

v

-RRB-

Theorem

asserts

that

the

difference

between

levels

-LRB-

u

-RRB-

and

-LRB-

v

-RRB-

may

become

as

large

as

the

length

of

the

longest

path

-RCB-

i

-LRB-

v

u

-RRB-

Hence

the

length

of

the

routing

path

-LRB-

u

v

-RRB-

which

represents

the

deleted

arc

-LRB-

u

v

-RRB-

can

be

proportional

to

the

length

of

the

longest

cycle

cut

by

-LRB-

u

v

-RRB-

Theorem

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

j

-RCB-

i

-LRB-

v

u

-RRB-

j

Proof

Assume

that

after

deletion

of

-LRB-

u

v

-RRB-

an

arc

-LRB-

x

y

-RRB-

is

deleted

from

some

-RCB-

k

-LRB-

v

u

-RRB-

k

I

How

can

this

happen

First

of

all

there

must

be

a

traversed

path

from

y

to

x

that

would

be

closed

into

a

traversed

cycle

C

by

-LRB-

x

y

-RRB-

-LRB-

see

Fig.

-RRB-

Hence

y

must

be

visited

before

x

and

by

assumption

after

the

deletion

of

-LRB-

u

v

-RRB-

from

After

this

deletion

the

algorithm

backtracks

along

the

path

-RCB-

-LRB-

v

u

-RRB-

and

continues

depthfirst

traversal

from

each

of

its

vertices

When

it

returns

to

v

it

traverses

other

paths

-RCB-

i

-LRB-

v

u

-RRB-

In

order

to

visit

y

-LRB-

before

x

-RRB-

there

must

be

a

path

-RCB-

m

-LRB-

v

u

-RRB-

m

I

m

k

and

a

vertex

z

on

it

such

that

there

is

an

untraversed

path

from

z

to

y

In

this

case

y

can

be

visited

before

x

and

the

path

-RCB-

k

-LRB-

v

u

-RRB-

can

be

cut

by

deleting

-LRB-

x

y

-RRB-

ffl

t

tffi

ffl

ffi

t

t

ss

ss

toe

v

u

z

-RCB-

k

-RCB-

m

x

y

-RCB-

C

Fig.

Cycle

cutting

Similarly

other

paths

-RCB-

i

-LRB-

v

u

-RRB-

i

I

may

be

cut

during

the

depth-first

traversal

When

the

traversal

is

completed

v

and

u

are

connected

by

a

family

f

-RCB-

i

-LRB-

v

u

-RRB-

of

paths

where

J

I

Since

the

tasks

along

each

-RCB-

i

-LRB-

v

u

-RRB-

i

J

are

assigned

their

levels

in

strictly

increasing

order

-LRB-

cf.

Lemma

-RRB-

we

conclude

that

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

j

-RCB-

i

-LRB-

v

u

-RRB-

j.

Hence

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

j

-RCB-

i

-LRB-

v

u

-RRB-

j.

To

see

that

this

bound

is

tight

assume

that

after

deletion

of

-LRB-

u

v

-RRB-

of

the

paths

-RCB-

i

-LRB-

v

u

-RRB-

i

I

is

cut

i.e.

that

J

I.

Deleted

backward

arcs

are

not

the

only

arcs

that

may

stretch

into

long

routing

paths

Indeed

this

may

happen

even

to

arcs

in

the

acyclic

subgraph

of

Gp

Let

-LRB-

u

v

-RRB-

be

an

arc

in

Besides

-LRB-

u

v

-RRB-

there

may

exist

other

paths

in

starting

from

u

and

ending

at

v

If

p

is

the

length

of

the

longest

such

path

then

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

p

implying

that

-LRB-

u

v

-RRB-

will

be

represented

by

-LRB-

u

v

-RRB-

whose

length

is

at

least

p

This

also

holds

for

acyclic

graphs

Gp

since

Gp

in

this

case

Hence

one

may

expect

no

vertical

stretching

only

if

Gp

is

a

tree

Horizontal

stretching

Let

us

now

show

that

may

also

be

horizontally

overstretched

across

Gn

Recall

that

the

second

step

of

places

layers

in

rows

of

Gn

and

then

arranges

the

tasks

within

rows

so

that

the

routing

paths

are

expected

to

be

as

vertical

as

possible

Still

this

permutation

process

may

produce

undesired

side

effects

In

particular

two

communicating

tasks

u

and

v

that

reside

in

adjacent

rows

would

ideally

be

allocated

to

adjacent

processors

however

the

permutation

process

may

separate

them

and

as

a

result

horizontally

stretch

the

routing

path

between

them

In

what

follows

we

show

that

the

column

distance

between

the

separated

tasks

may

become

very

large

Let

-LRB-

u

v

-RRB-

be

an

arc

in

Gp

and

assume

w.l.g.

that

-LRB-

u

-RRB-

-LRB-

v

-RRB-

Recall

that

N

-LRB-

u

-RRB-

denotes

the

neighborhood

of

u

in

Gp

and

that

col

-LRB-

u

-RRB-

is

the

index

of

the

column

in

Gn

where

u

resides

after

completion

of

the

permutation

process

Then

we

have

the

following

Theorem

jcol

-LRB-

u

-RRB-

col

-LRB-

v

-RRB-

j

O

-LRB-

jN

-LRB-

u

-RRB-

j

jN

-LRB-

v

-RRB-

j

-RRB-

Proof

Assume

that

all

adjacent

tasks

of

u

and

v

-LRB-

except

u

and

v

themselves

-RRB-

reside

in

the

same

layer

i.e.

for

some

i

N

-LRB-

u

-RRB-

fvg

ae

Li

and

N

-LRB-

v

-RRB-

fug

ae

Li

The

initial

placement

of

the

layers

may

put

N

-LRB-

u

-RRB-

fvg

to

the

left

of

N

-LRB-

v

-RRB-

fug

-LRB-

Fig.

-RRB-

Then

the

permutation

process

moves

u

and

v

into

columns

col

-LRB-

u

-RRB-

and

col

-LRB-

v

-RRB-

respectively

so

that

col

-LRB-

u

-RRB-

-LRB-

col

-LRB-

v

-RRB-

m

P

j

j

-RRB-

and

col

-LRB-

v

-RRB-

-LRB-

col

-LRB-

u

-RRB-

m

n

P

j

m

j

-RRB-

where

m

jN

-LRB-

u

-RRB-

j

and

n

jN

-LRB-

v

-RRB-

j

In

order

to

evaluate

the

column

distance

jcol

-LRB-

u

-RRB-

col

-LRB-

v

-RRB-

j

we

solve

the

above

system

of

equations

and

obtain

col

-LRB-

u

-RRB-

mn

-LRB-

m

n

P

j

m

j

nm

P

j

j

-RRB-

and

col

-LRB-

v

-RRB-

mn

-LRB-

m

P

j

j

mm

n

P

j

m

j

-RRB-

Then

jcol

-LRB-

u

-RRB-

col

-LRB-

v

-RRB-

j

-LRB-

m

-RRB-

-LRB-

n

-RRB-

-LRB-

m

n

-RRB-

-LRB-

mn

-RRB-

which

is

of

the

order

O

-LRB-

m

n

-RRB-

We

can

generalize

the

above

finding

as

follows

Notice

first

that

such

a

pathological

v

v

CCCCCCCCCC

AAAAAAA

u

v

col

-LRB-

u

-RRB-

col

-LRB-

v

-RRB-

-LRB-

u

-RRB-

-LRB-

v

-RRB-

i

N

-LRB-

u

-RRB-

fvg

N

-LRB-

v

-RRB-

fug

Fig.

Horizontal

stretching

the

permutation

process

separates

tasks

u

and

v.

situation

may

simultaneously

develop

on

several

rows

of

Gn

Now

consider

a

path

in

Gp

traversing

tasks

uk

The

path

is

mapped

by

into

a

sequence

of

routing

paths

-LRB-

ui

ui

-RRB-

i

k

Using

arguments

of

the

previous

theorem

we

find

that

the

column

distance

between

the

starting

and

ending

task

is

jcol

-LRB-

-RRB-

col

-LRB-

uk

-RRB-

j

O

-LRB-

kP

i

jN

-LRB-

ui

-RRB-

j

-RRB-

The

above

findings

refer

to

row

and

column

distances

as

they

are

after

the

second

step

of

But

clearly

additional

vertical

and

horizontal

stretching

of

routing

paths

may

occur

during

the

last

step

of

since

new

rows

and/or

columns

may

be

inserted

into

Gn

in

order

to

resolve

bottleneck

situations

To

summarize

this

section

are

exaggeratedly

stretched

across

Gn

That

is

many

routing

paths

connect

tasks

of

very

distant

rows/columns

As

a

result

exhibit

two

disadvantages

First

of

all

since

the

time

complexity

of

the

routing

operation

is

not

negligible

execution

slowdown

may

occur

as

a

result

of

remote

communication

between

some

tasks

Secondly

may

consume

an

excessive

area

of

the

network

Improvements

of

the

original

scheme

In

this

section

we

describe

four

nontrivial

improvements

of

the

mapping

scheme

First

we

pay

attention

to

the

initial

step

of

and

discuss

better

ways

to

construct

acyclic

subgraphs

Then

we

concentrate

on

the

second

step

of

and

consider

two

improvements

of

the

placement

of

the

layers

Finally

we

discuss

the

last

step

of

the

path

construction

For

the

sake

of

concreteness

let

us

choose

a

cost

function

first

We

use

the

so-called

total

communication

cost

defined

as

K

-LRB-

-LRB-

Gp

-RRB-

-RRB-

P

-LRB-

u

v

-RRB-

-LRB-

u

v

-RRB-

There

are

two

reasons

for

our

choice

Firstly

K

is

one

of

the

common

measures

for

evaluating

the

quality

of

a

mapping

since

it

represents

the

total

price

of

routing

all

messages

between

related

tasks

Secondly

it

accumulates

all

the

undesired

effects

of

we

described

in

previous

section

To

see

this

recall

that

the

dilation

of

an

arc

-LRB-

u

v

-RRB-

Ap

is

dil

-LRB-

u

v

-RRB-

-LRB-

u

v

-RRB-

j

However

we

will

adopt

K

only

as

a

vehicle

for

improving

several

other

important

quality

measures

-LRB-

see

Section

-RRB-

Unfortunately

the

problem

of

finding

the

mapping

such

that

K

-LRB-

-LRB-

Gp

-RRB-

-RRB-

is

minimal

is

NP-complete

To

see

this

fix

the

degree

of

the

graph

Gn

to

r

This

turns

our

problem

into

the

optimal

linear

arrangement

problem

which

is

NP

complete

-LSB-

-RSB-

Thus

being

a

generalization

of

an

NP-complete

problem

our

problem

is

NP-hard

Clearly

it

is

also

in

the

class

NP

As

a

result

instead

of

searching

for

we

focus

on

the

improvements

of

Cycle

cutting

Consider

the

first

step

of

and

in

particular

the

construction

of

the

acyclic

subgraph

of

Gp

Let

D

Ap

be

the

set

of

arcs

that

have

been

deleted

during

the

depth-first

traversal

of

Gp

Recall

that

these

arcs

may

stretch

into

long

routing

paths

i.e.

arcs

-LRB-

u

v

-RRB-

D

may

have

large

dilations

dil

-LRB-

u

v

-RRB-

Consequently

the

sum

P

-LRB-

u

v

-RRB-

dil

-LRB-

u

v

-RRB-

may

become

very

large

making

the

total

communication

cost

K

-LRB-

-LRB-

Gp

-RRB-

-RRB-

large

as

well

Is

there

a

better

way

to

delete

arcs

from

Gp

The

decision

problem

related

to

this

question

is

given

below

Problem

cycle

cutting

Instance

Directed

graph

Gp

-LRB-

Vp

Ap

-RRB-

and

a

bound

B

Question

Is

there

a

subset

D

Ap

so

that

-LRB-

Vp

Ap?D

-RRB-

is

acyclic

and

P

-LRB-

u

v

-RRB-

-LRB-

u

v

-RRB-

B

Theorem

cycle

cutting

is

NP-complete

Proof

Consider

the

subproblem

where

dil

-LRB-

u

v

-RRB-

for

each

-LRB-

u

v

-RRB-

Ap

Note

that

in

this

case

P

-LRB-

u

v

-RRB-

-LRB-

u

v

-RRB-

jDj

Now

the

question

is

whether

there

exists

some

D

Ap

such

that

-LRB-

Vp

Ap?D

-RRB-

is

acyclic

and

jDj

B

This

is

the

feedback

arc

set

problem

which

is

NP-complete

-LSB-

-RSB-

Hence

cycle

cutting

is

NP-hard

It

is

also

in

the

class

NP

Layer

placement

I

We

now

look

at

the

second

step

of

the

mapping

scheme

As

noted

this

step

consists

of

the

initial

placement

of

layers

of

Gp

on

the

rows

of

Gn

placing

i-th

layer

on

the

i-th

row

followed

by

the

permutation

process

that

rearranges

mapped

tasks

within

rows

so

that

the

routing

paths

-LRB-

u

v

-RRB-

are

expected

to

be

as

vertical

as

possible

Let

us

see

how

successful

this

permutation

process

can

be

Since

dil

-LRB-

u

v

-RRB-

-LRB-

u

v

-RRB-

j

and

-LRB-

u

v

-RRB-

j

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

we

find

that

K

-LRB-

-LRB-

Gp

-RRB-

-RRB-

X

-LRB-

u

v

-RRB-

-LRB-

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

-RRB-

Thus

no

matter

how

successful

the

permutation

process

is

it

can

not

improve

the

cost

function

below

this

lower

bound

The

situation

is

even

worse

however

since

it

follows

from

Section

that

this

lower

bound

may

become

very

large

Hence

in

order

to

allow

the

permutation

process

to

be

more

successful

one

should

improve

this

lower

bound

As

we

will

shortly

see

this

can

be

achieved

in

principle

by

using

a

better

initial

placement

Let

us

generalize

the

lower

bound

First

we

reduce

a

given

Gp

into

an

undirected

labeled

graph

GRp

Informally

the

vertices

of

GRp

represent

layers

of

Gp

and

two

vertices

are

connected

by

an

edge

in

GRp

iff

the

corresponding

layers

are

connected

by

at

least

one

arc

in

Gp

Formally

let

L

denote

the

family

of

layers

Li

constructed

by

the

first

step

of

and

let

a

-LRB-

Li

Lj

-RRB-

-LRB-

or

in

this

subsection

simply

aij

-RRB-

denote

the

number

of

arcs

in

Gp

connecting

layers

Li

and

Lj

Then

the

reduced

graph

is

GRp

-LRB-

V

Rp

ERp

-RRB-

where

V

Rp

L

and

ERp

ffLi

LjgjLi

Lj

L

aij

g.

Now

let

r

L

Z

be

a

one-to-one

function

associating

a

row

number

to

each

of

the

layers

Recall

that

uses

simply

the

function

r

-LRB-

Li

-RRB-

i.

Considering

this

we

can

generalize

the

lower

bound

as

follows

P

-LRB-

u

v

-RRB-

-LRB-

j

-LRB-

u

-RRB-

-LRB-

v

-RRB-

j

-RRB-

P

-LRB-

u

v

-RRB-

-LRB-

jr

-LRB-

L

-LRB-

u

-RRB-

-RRB-

r

-LRB-

L

-LRB-

v

-RRB-

-RRB-

j

-RRB-

P

fLi

aij

-LRB-

jr

-LRB-

Li

-RRB-

r

-LRB-

Lj

-RRB-

j

-RRB-

Hence

K

-LRB-

-LRB-

Gp

-RRB-

-RRB-

X

fLi

aij

-LRB-

jr

-LRB-

Li

-RRB-

r

-LRB-

Lj

-RRB-

j

-RRB-

Since

this

lower

bound

is

valid

for

any

function

r

L

Z

one

should

use

the

optimal

one

say

r

which

minimizes

the

above

sum

If

the

initial

placement

was

done

by

r

-LRB-

instead

of

r

Li

i

-RRB-

then

this

would

allow

the

permutation

process

to

be

more

successful

This

yields

an

optimization

problem

with

the

following

decision

version

Problem

bound

minimization

Instance

Undirected

graph

GRp

-LRB-

V

Rp

ERp

-RRB-

a

label

aij

for

each

pair

Li

Lj

V

Rp

and

a

bound

B

Question

Is

there

a

one-to-one

function

r

V

Rp

jV

Rp

jg

so

that

X

fLi

aij

-LRB-

jr

-LRB-

Li

-RRB-

r

-LRB-

Lj

-RRB-

j

-RRB-

B

Theorem

bound

minimization

is

NP-complete

Proof

Consider

the

subproblem

where

aij

for

each

pair

of

vertices

Li

Lj

V

Rp

Now

the

question

is

whether

there

is

a

function

r

such

that

P

fLi

jr

-LRB-

Li

-RRB-

r

-LRB-

Lj

-RRB-

j

B

jERp

j

This

is

the

optimal

linear

arrangement

problem

which

is

known

to

be

NP-complete

-LSB-

-RSB-

Therefore

the

bound

minimization

problem

is

NP-hard

Clearly

it

is

also

in

the

class

NP

Layer

placement

II

We

have

shown

in

Section

that

may

become

horizontally

overstretched

One

of

the

reasons

for

this

lies

in

the

last

step

of

the

mapping

scheme

that

is

in

the

routing

path

construction

Recall

that

when

too

many

routing

paths

have

to

be

routed

through

a

small

area

on

Gn

only

the

last

decision

in

the

routing

process

is

changed

If

this

does

not

solve

the

problem

then

a

row

or

column

of

vertices

is

simply

inserted

into

Gn

thus

making

an

avenue

through

the

thicket

In

what

follows

we

show

how

the

frequency

of

column

insertions

can

be

reduced

Informally

we

search

for

an

initial

placement

of

layers

such

that

for

each

row

of

Gn

the

number

of

routing

paths

that

cross

the

row

is

minimal

Consider

again

the

reduced

graph

GRp

-LRB-

V

Rp

ERp

-RRB-

of

a

program

graph

Gp

and

let

r

V

Rp

jV

Rp

jg

be

a

one-to-one

function

that

associates

with

each

layer

Li

V

Rp

the

index

of

the

row

in

Gn

where

Li

is

to

be

placed

during

the

initial

step

of

the

mapping

Recall

that

a

-LRB-

Li

Lj

-RRB-

is

the

number

of

arcs

in

Gp

that

connect

layers

Li

and

Lj

Then

the

number

of

routing

paths

that

cross

the

row

k

k

jV

Rp

j

is

P

i

j

i

k

j

a

-LRB-

r

-LRB-

i

-RRB-

r

-LRB-

j

-RRB-

-RRB-

We

can

now

state

the

following

problem

Problem

crossing

minimization

Instance

Undirected

graph

GRp

-LRB-

V

Rp

ERp

-RRB-

a

function

a

V

Rp

V

Rp

Z

and

B

Question

Is

there

a

one-to-one

function

r

V

Rp

jV

Rp

jg

so

that

P

i

j

i

k

j

a

-LRB-

r

-LRB-

i

-RRB-

r

-LRB-

j

-RRB-

-RRB-

B

for

each

k

where

k

jV

Rp

j.

Theorem

crossing

minimization

is

NP-complete

Proof

Consider

the

subproblem

where

a

-LRB-

Ls

Lt

-RRB-

for

each

fLs

Ltg

ERp

The

subproblem

asks

for

a

function

r

satisfying

the

condition

P

i

j

i

k

j

B

where

k

jV

Rp

j

This

condition

is

equivalent

to

jffPs

Ptg

ERp

jr

-LRB-

Ps

-RRB-

k

r

-LRB-

Pt

-RRB-

gj

B

for

k

jV

Rp

j

which

is

in

turn

equivalent

to

jffPs

Ptg

jr

-LRB-

Ps

-RRB-

k

r

-LRB-

Pt

-RRB-

gj

B

jV

Rp

j

for

k

jV

Rp

j.

Now

searching

for

a

function

r

which

satisfies

the

last

condition

amounts

to

the

well-known

minimum

cut

linear

arrangement

problem

which

is

NP-complete

-LSB-

-RSB-

This

proves

the

crossing

minimization

to

be

NP-hard

It

is

easy

to

show

that

it

is

in

the

class

NP

Extended

backtracking

When

too

many

paths

have

to

be

routed

through

a

small

area

on

Gn

only

the

last

decision

in

the

path

construction

is

changed

If

this

does

not

solve

the

problem

brute

force

is

used

and

a

column/row

is

inserted

into

Gn

It

may

seem

at

first

glance

that

such

an

impatient

policy

is

improper

since

it

stretches

Therefore

it

is

seductive

to

allow

backtracking

through

several

decisions

in

order

to

bypass

problematic

areas

However

these

bypasses

would

increase

the

total

communication

cost

K

-LRB-

-LRB-

Gp

-RRB-

-RRB-

In

summary

we

have

found

three

nontrivial

improvements

of

the

mapping

scheme

-LRB-

and

shown

that

the

fourth

one

does

not

promise

as

much

as

it

may

seem

at

first

glance

-RRB-

However

we

have

also

been

able

to

prove

that

these

improvements

involve

solving

NP-complete

problems

Therefore

in

order

to

efficiently

integrate

the

improvements

into

the

mapping

scheme

one

has

to

resort

to

heuristic

algorithms

for

solving

these

problems

Configuration

refinement

Another

avenue

to

investigate

is

that

of

improving

the

results

of

the

mapping

scheme

in

addition

to

or

instead

of

the

scheme

itself

In

this

case

the

initial

mapping

is

followed

by

a

refinement

procedure

that

incrementally

modifies

the

configuration

in

a

manner

that

minimizes

the

total

communication

cost

More

precisely

an

existing

mapping

say

is

fixed

and

an

additional

optimal

transformation

o

of

-LRB-

Gp

-RRB-

is

searched

to

minimize

the

total

communication

cost

K

by

a

composed

mapping

o

ffi

However

the

problem

of

finding

o

is

NP-complete

To

see

this

observe

that

to

this

problem

we

can

reduce

the

problem

of

finding

the

optimal

mapping

in

polynomial

time

simply

by

taking

o

ffi

As

the

latter

problem

is

NP-complete

-LRB-

see

Section

-RRB-

so

is

the

former

Therefore

we

have

to

resort

to

suboptimal

refinement

procedures

In

particular

we

will

present

four

heuristic

refinement

procedures

all

of

them

taking

advantage

of

the

findings

described

in

Section

i.e.

that

are

generally

overstretched

across

Gn

The

method

The

refinement

procedures

will

be

based

on

the

following

method

Think

of

the

problem

graph

Gp

as

a

mechanical

system

with

physical

vertices

and

arcs

between

them

made

of

identical

elastic

bands

Then

the

mapping

can

be

viewed

as

stretching

this

system

on

Gn

Now

stretching

of

an

arc

induces

a

physical

force

of

attraction

which

tends

to

pull

the

endpoint

vertices

together

This

force

is

proportional

to

the

dilation

of

the

arc

As

a

result

the

system

tends

to

shrink

until

a

point

is

reached

where

the

potential

energy

or

alternatively

the

sum

of

all

forces

in

arcs

can

no

further

be

lowered

Being

proportional

to

this

sum

the

total

communication

cost

K

is

reduced

as

well

The

intention

is

to

simulate

this

shrinking

process

In

nature

shrinking

would

be

a

continuous

process

with

changes

occurring

simultaneously

at

different

places

of

the

system

In

this

paper

however

we

take

a

simplified

view

in

order

to

make

the

simulation

tractable

That

is

we

make

the

following

assumptions

First

we

assume

that

shrinking

is

a

discrete

process

with

changes

occurring

in

discrete

moments

Second

we

assume

that

the

process

is

sequential

meaning

that

only

one

change

at

a

time

is

allowed

Finally

we

assume

that

changes

are

tractable

i.e.

they

are

small

enough

to

be

easily

simulated

Specifically

we

assume

that

each

change

consists

of

-LRB-

i

-RRB-

the

shifting

a

task

from

its

host

processor

to

one

of

the

adjacent

processors

and

-LRB-

ii

-RRB-

of

rerouting

all

the

paths

incident

to

the

shifted

task

From

now

on

we

call

such

changes

basic

transformations

As

a

result

the

shrinking

process

is

represented

by

a

sequence

of

basic

transformations

which

is

referred

to

as

the

basic

sequence

Since

in

general

many

basic

sequences

can

mimic

the

shrinking

process

the

aim

is

to

construct

the

one

which

is

a

good

approximation

of

the

optimal

transformation

o

More

rigorously

given

the

initial

configuration

-LRB-

Gp

-RRB-

we

search

for

a

basic

sequence

o

that

makes

the

cost

K

-LRB-

o

ffi

-LRB-

Gp

-RRB-

-RRB-

as

low

as

possible

Refinement

procedures

It

turns

out

that

the

systematic

exploration

of

all

basic

sequences

in

order

to

find

the

best

one

is

prohibitively

expensive

To

appreciate

this

note

first

that

associated

with

a

basic

sequence

o

ok

ffiok

ffi

is

the

sequence

of

configurations

Mk

where

-LRB-

Gp

-RRB-

and

Mi

oi

-LRB-

Mi

-RRB-

for

i

k

During

the

construction

of

o

each

oi

has

to

be

selected

from

the

set

of

all

basic

transformations

applicable

to

Mi

But

clearly

there

are

O

-LRB-

rjVpj

-RRB-

such

transformations

where

r

is

the

degree

of

Gn

and

Vp

is

the

set

of

tasks

in

Gp

Consequently

there

are

O

-LRB-

-LRB-

rjVpj

-RRB-

k

-RRB-

basic

sequences

of

length

k.

Therefore

we

resort

to

heuristic

procedures

to

construct

basic

sequences

The

procedures

we

deal

with

comply

with

the

following

paradigm

-LRB-

Fig.

-RRB-

o

identity

-LRB-

Gp

-RRB-

i

repreat

Select

-LRB-

oi

-RRB-

if

Accept

-LRB-

oi

-RRB-

then

o

oi

ffi

o

Mi

oi

-LRB-

Mi

-RRB-

i

i

endif

until

T

erminate

Fig.

The

construction

of

basic

sequences

At

the

i-th

step

a

basic

transformation

oi

is

selected

from

the

set

of

all

basic

transformations

applicable

to

Mi

Then

oi

is

tested

for

acceptability

If

accepted

it

is

added

to

the

basic

sequence

o

and

the

next

configuration

Mi

is

constructed

-LRB-

It

is

convenient

to

initialize

o

to

the

identity

transformation

that

leaves

configurations

unchanged

-RRB-

The

construction

is

completed

when

a

termination

condition

is

met

Several

heuristic

procedures

can

be

derived

by

taking

different

selection

acceptance

and

termination

criteria

In

what

follows

we

describe

four

such

procedures

Natural

shrinking

-LRB-

NS

-RRB-

The

first

refinement

procedure

is

inspired

by

mechanical

system

and

is

accordingly

referred

to

as

natural

shrinking

-LRB-

NS

-RRB-

Let

Mi

be

the

current

configuration

For

each

task

u

of

Mi

and

each

routing

path

incident

to

u

a

physical

force

of

attraction

is

assigned

to

u

proportional

in

magnitude

to

the

length

of

the

path

and

direction

from

u

to

the

next

processor

on

the

path

Let

F

-LRB-

u

-RRB-

be

the

vector

sum

of

all

such

forces

acting

upon

u

F

-LRB-

u

-RRB-

its

magnitude

and

d

-LRB-

u

-RRB-

one

of

r

directions

from

u

to

adjacent

processors

that

is

closest

to

F

-LRB-

u

-RRB-

-LRB-

see

Fig.

-RRB-

Informally

selection

is

performed

by

choosing

that

basic

transformation

which

shifts

a

vertex

with

the

largest

force

F

in

the

direction

of

that

force

Let

us

go

into

some

more

detail

Let

be

ordering

of

all

vertices

of

Mi

such

that

F

-LRB-

uk

-RRB-

F

-LRB-

uk

-RRB-

where

k

jVpj

Associated

with

it

is

the

sequence

of

pairs

-LRB-

uk

d

-LRB-

uk

-RRB-

-RRB-

Notice

that

each

pair

represents

a

basic

transformation

namely

the

one

which

in

accordance

with

the

force

F

-LRB-

uk

-RRB-

attempts

to

move

uk

in

the

direction

d

-LRB-

uk

-RRB-

The

smaller

is

k

the

larger

is

the

force

F

-LRB-

uk

-RRB-

that

attempts

to

perform

the

transformation

-LRB-

uk

d

-LRB-

uk

-RRB-

-RRB-

Then

the

selected

basic

transformation

oi

is

represented

by

-LRB-

vm

d

-LRB-

vm

-RRB-

-RRB-

where

m

is

the

smallest

index

such

that

vm

can

be

moved

in

direction

d

-LRB-

vm

-RRB-

to

the

adjacent

processor

rerouting

all

incident

paths

Such

a

selection

will

be

called

natural

selection

and

the

transformations

represented

by

pairs

-LRB-

u

d

-LRB-

u

-RRB-

-RRB-

will

be

called

natural

transformations

HH

HH

HH

HH

w

HH

HH

HH

HH

HH

HH

HH

HH

v

HH

HH

HH

HH

u

HH

HH

HH

HH

HH

HH

HH

HH

T

TT

@I

oe

CCCCCCCCCW

JJ

JJ

JJ

JJ

JJ

d

-LRB-

u

-RRB-

F

-LRB-

u

-RRB-

Fig.

Forces

of

attraction

acting

upon

vertex

u.

Thus

natural

selection

picks

the

most

promising

basic

transformation

i.e.

the

natural

transformation

oi

yielding

the

greatest

decrease

in

the

cost

K

after

applying

oi

on

Mi

Nevertheless

K

may

still

increase

due

to

rerouting

problems

that

may

occur

during

the

application

of

oi

In

order

to

remain

faithful

to

the

mechanical

system

the

selected

natural

transformation

oi

is

accepted

only

if

it

does

not

increase

the

cost

K

i.e.

if

K

K

-LRB-

oi

-LRB-

Mi

-RRB-

-RRB-

K

-LRB-

Mi

-RRB-

Otherwise

the

transformation

is

rejected

and

the

next

one

is

selected

from

the

rest

of

the

natural

transformations

i.e.

from

the

sequence

of

pairs

-LRB-

uk

d

-LRB-

uk

-RRB-

-RRB-

where

m

k

jVpj

The

algorithm

terminates

if

no

such

transformation

exists

Threshold

restretching

-LRB-

TR

-RRB-

Natural

shrinking

is

a

fast

procedure

but

it

generally

gets

trapped

in

a

local

minimum

That

is

to

say

it

may

lead

to

a

configuration

with

no

natural

transformations

decreasing

K

while

K

is

still

not

minimized

This

corresponds

to

the

situation

where

shrinking

of

the

mechanical

system

has

been

blocked

by

an

ill-starred

arrangement

of

its

vertices

But

clearly

if

a

temporal

restretching

of

the

system

were

allowed

with

the

purpose

of

avoiding

the

trapped

situation

then

further

shrinking

might

be

possible

This

brings

us

to

the

second

refinement

procedure

which

we

call

threshold

restretching

-LRB-

TR

-RRB-

The

selection

of

basic

transformations

oi

is

still

natural

but

now

oi

is

accepted

if

it

produces

a

configuration

that

is

not

much

worse

then

the

old

one

i.e.

if

given

some

threshold

t

it

is

true

that

K

t

Such

an

acceptance

rule

enables

the

refinement

procedure

to

avoid

becoming

trapped

in

a

local

minimum

In

addition

if

t

is

appropriately

lowered

during

the

execution

of

the

procedure

then

bad

acceptances

become

more

and

more

rare

which

in

turn

prevents

the

configurations

obtained

so

far

from

growing

too

much

worse

Probabilistic

restretching

-LRB-

PR

-RRB-

The

above

procedure

is

capable

of

escaping

only

from

shallow

local

minima

i.e.

those

whose

depths

are

at

most

t

In

contrast

our

next

refinement

procedure

which

we

call

probabilistic

restretching

-LRB-

PR

-RRB-

allows

escaping

from

any

local

minima

The

procedure

uses

natural

selection

of

basic

transformations

but

borrows

the

Metropolis

criterion

from

the

simulated

annealing

algorithm

to

accept

them

More

specifically

let

t

Then

a

selected

natural

transformation

oi

is

unconditionally

accepted

if

K

and

is

accepted

only

with

the

probability

e

K

t

if

K

Since

t

is

slowly

lowered

during

the

running

time

also

the

acceptance

probability

is

lowered

making

bad

acceptances

more

and

more

improbable

This

prevents

the

results

of

the

procedure

from

being

too

spoiled

Usually

t

is

called

the

temperature

while

the

term

cooling

schedule

refers

to

the

set

of

rules

used

to

lower

t

There

are

several

cooling

schedules

-LSB-

-RSB-

Informally

we

use

the

following

one

t

is

exponentially

decreased

i.e.

each

time

it

is

lowered

by

a

constant

fraction

at

each

t

transformations

are

attempted

until

either

a

number

of

acceptances

have

occurred

or

a

number

of

selections

have

been

made

The

procedure

terminates

when

sufficiently

few

acceptances

are

occurring

at

successive

temperatures

Details

will

be

given

in

the

next

section

Simulated

annealing

-LRB-

SA

-RRB-

In

contrast

to

the

previous

procedures

the

last

one

randomly

selects

basic

transformations

That

is

both

vertex

and

the

direction

of

its

move

are

randomly

selected

Clearly

a

selected

basic

transformation

may

increase

the

cost

function

K

We

use

the

same

acceptance

criterion

as

in

PR

Note

that

this

amounts

to

the

well-known

simulated

annealing

-LRB-

SA

-RRB-

algorithm

Results

and

discussion

We

have

experimentally

tested

the

concepts

described

in

the

previous

section

The

results

are

given

in

this

section

-RRB-

Additional

quality

measures

Recall

from

Section

that

we

use

the

total

communication

cost

K

only

as

a

means

to

improve

other

quality

measures

Let

and

M

denote

an

initial

and

refined

configuration

respectively

We

are

interested

in

the

following

quality

measures

-LCB-

chip

size

C

which

is

the

number

of

processors

in

the

smallest

rectangle

enclosing

M

-LCB-

average

speedup

S

g

where

and

T

are

ex

times

of

and

M

resp.

-LCB-

extra

processors

E

i.e.

the

number

of

processors

used

only

for

routing

purposes

-LCB-

maximal

dilation

D

max

-LRB-

u

v

-RRB-

dil

-LRB-

u

v

-RRB-

and

-LCB-

average

dilation

D

K

jApj

Comments

The

definition

of

C

is

based

on

the

fact

that

processors

of

Gn

can

be

arranged

into

rows

and

columns

when

embedded

in

the

plane

as

indicated

in

Fig.

Next

when

considering

the

execution

time

of

M

we

note

first

that

depending

on

initial

data

several

different

executions

are

possible

Therefore

we

adopt

the

average

execution

time

T

as

the

relevant

measure

However

it

is

more

convenient

to

use

the

average

speedup

S

which

tells

how

much

faster

on

average

is

the

execution

of

M

compared

to

-LRB-

on

the

same

input

data

-RRB-

-RRB-

Experiments

We

implemented

a

software

tool

that

is

based

on

the

concepts

described

in

the

previous

section

and

supports

all

the

four

refinement

procedures

For

the

initial

the

original

mapping

was

chosen

Thus

the

tool

implements

four

enhanced

mapping

schemes

denoted

by

NS

TR

PR

and

SA

To

evaluate

their

performances

we

have

carried

out

a

number

of

tests

We

used

a

set

of

realistic

problem

graphs

from

-LSB-

-RSB-

describing

Runge-Kutta

program

random

generator

Newton

's

square

root

factorial

function

sum

of

two

inner

products

of

four

independent

vectors

coefficients

of

a

spring-mass

system

even

process

-LRB-

average

sum

and

minimum

of

the

selected

values

-RRB-

conditional

construct

dynamic

scene

analysis

complex

number

multiplication

matrix

multiplication

and

LU

decomposition

For

the

target

machine

we

used

a

processor

array

from

-LSB-

-RSB-

In

short

the

array

is

datadriven

and

can

host

arbitrary

algorithms

Each

processor

has

six

immediate

neighbors

and

is

connected

to

them

by

point-to-point

links

Synchronization

among

the

processors

is

achieved

implicitly

every

time

a

processor

makes

its

result

available

to

another

processor

as

an

input

operand

to

the

latter

's

computation

In

addition

each

processor

can

directly

communicate

through

communication

bus

with

an

external

host

computer

both

for

code

down-loading

and

for

data

I/O

The

instruction

timings

in

clock

cycles

for

some

of

the

operations

are

-LRB-

route

-RRB-

-LRB-

compare

add/subtract

-RRB-

-LRB-

multiply

-RRB-

and

-LRB-

divide

-RRB-

-LSB-

-RSB-

Note

that

the

corresponding

network

graph

Gn

is

a

We

have

encountered

such

a

Gn

in

Figs

and

Let

us

describe

in

more

detail

the

cooling

schedule

we

use

in

PR

and

SA

Initially

the

temperature

is

set

to

ffK

-LRB-

-LRB-

Gp

-RRB-

-RRB-

where

is

such

that

initially

guarantees

at

least

probability

of

accepting

reasonably

bad

basic

transformations

i.e.

those

that

increase

K

by

at

most

At

each

temperature

ti

changes

are

attempted

until

jVpj

acceptances

have

occurred

or

ffijVpj

selections

have

been

made

where

ffi

After

that

ti

is

lowered

to

ti

ti

where

Procedures

terminate

when

sufficiently

few

acceptances

are

occurring

at

successive

temperatures

Several

different

executions

of

RS

and

SA

can

be

obtained

by

varying

parameters

ff

and

ffi

We

considered

cases

where

and

ffi

Recall

that

TS

uses

the

threshold

instead

of

the

Metropolis

criterion

when

accepting

a

selected

basic

transformation

Again

different

executions

of

TS

are

obtained

by

varying

the

speed

at

which

the

threshold

t

is

lowered

This

cooling

schedule

is

similar

to

the

one

above

but

now

with

and

ffi

Example

Fig.

shows

initial

configuration

of

the

GRungeKutta

problem

graph

Using

NS

we

obtained

a

refined

configuration

depicted

in

Fig

A

refinement

produced

by

TR

is

shown

in

Fig.

The

results

of

PR

and

SA

are

given

in

Fig.

and

Fig.

respectively

HH

HH

oe

oe

HH

HH

oe

HH

oe

HH

HH

HH

HH

HH

HH

oe

HH

HH

oe

Fig.

Initial

configuration

-LRB-

GRungeKutta

-RRB-

for

the

RungeKutta

program

The

quality

measures

are

total

communication

cost

K

chip

size

C

extra

processors

E

max

dilation

D

avrg

dilation

D

HH

oe

oe

oe

oe

HH

HH

HH

HH

oe

HH

HH

a

-RRB-

HH

oe

oe

oe

oe

oe

oe

HH

b

-RRB-

Continued

on

the

next

page

HH

oe

oe

oe

oe

oe

oe

oe

oe

HH

c

-RRB-

oe

oe

HH

oe

HH

oe

oe

oe

d

-RRB-

Fig.

Refined

configurations

for

the

RungeKutta

program

a

-RRB-

after

NS

K

C

S

E

D

D

b

-RRB-

after

TR

K

C

S

E

D

D

-LRB-

and

ffi

-RRB-

c

-RRB-

after

PR

K

C

S

E

D

D

-LRB-

ffi

-RRB-

d

-RRB-

after

SA

K

C

S

E

D

D

-LRB-

and

ffi

-RRB-

Clearly

given

some

problem

graph

the

results

of

TR

PR

and

SA

depend

on

parameters

ffi

of

the

cooling

schedule

We

therefore

ran

these

procedures

at

various

cooling

schedules

In

addition

being

probabilistic

PR

and

SA

were

run

ten

to

fifteen

times

at

each

cooling

schedule

Table

shows

average

values

of

C

S

and

D

for

GNewton

For

some

other

problem

graphs

Tables

and

show

how

initial

values

of

C

S

and

D

resp

were

improved

by

NS

and

on

average

by

TR

PR

and

SA

For

Table

Average

C

S

and

D

for

Newton

at

some

cooling

schedules

refinement

procedure

C

S

D

ffi

TR

PR

SA

instance

Table

shows

that

in

order

to

map

GRungeKutta

with

the

chip

of

the

size

is

needed

However

the

chip

of

the

size

suffices

if

NS

is

used

instead

of

The

average

chip

sizes

required

by

the

mappings

TR

PR

and

SA

are

and

respectively

Table

Average

values

of

C

for

some

problem

graphs

RungeKutta

Newton

EvenProcess

Conditional

Mapping

jVpj

jApj

jVpj

jApj

jVpj

jApj

jVpj

jApj

NS

TR

PR

SA

Table

shows

that

using

NS

instead

of

when

mapping

GRungeKutta

yields

speedup

S

That

is

to

say

RungeKutta

executes

times

faster

on

average

if

mapped

by

NS

instead

of

The

average

speedup

resulting

from

SA

is

even

higher

Clearly

the

improvements

of

C

and

S

result

from

the

reduction

of

the

average

dilation

D

-LRB-

Table

-RRB-

Since

D

is

proportional

to

K

it

follows

that

the

reason

for

these

improvements

lies

in

the

reduction

of

K.

Table

Average

values

of

S

for

some

problem

graphs

RungeKutta

Newton

EvenProcess

Conditional

Mapping

jVpj

jApj

jVpj

jApj

jVpj

jApj

jVpj

jApj

NS

TR

PR

SA

Table

Average

values

of

D

for

some

problem

graphs

RungeKutta

Newton

EvenProcess

Conditional

Mapping

jVpj

jApj

jVpj

jApj

jVpj

jApj

jVpj

jApj

NS

TR

PR

SA

Table

summarizes

improvements

-LRB-

in

-RRB-

of

the

quality

measures

when

enhanced

mappings

NS

TR

PR

or

SA

were

used

instead

of

the

mapping

The

average

reduction

in

the

chip

size

C

was

between

and

depending

on

the

mapping

used

Note

that

at

the

same

time

the

average

execution

time

T

was

reduced

by

to

Table

Average

relative

improvements

-LRB-

in

-RRB-

Mapping

K

C

T

E

D

D

NS

TR

PR

SA

manual

Generally

it

is

difficult

to

say

how

close

to

optimal

these

refinements

are

since

there

is

no

efficient

way

of

knowing

what

the

best

configuration

for

a

specific

problem

graph

is

However

using

the

interactive

mode

of

our

software

tool

we

were

able

to

manually

obtain

optimal

configurations

i.e.

those

having

the

cost

K

close

to

The

results

are

shown

in

Table

-RRB-

Discussion

In

parallel

computing

the

question

of

whether

efficient

universality

can

be

found

has

no

clear

answer

yet

in

spite

of

the

fact

that

several

models

of

realistic

machines

have

been

proposed

and

many

parallel

computers

have

been

built

This

was

the

reason

for

suggesting

the

data-driven

processor

array

which

represents

a

radical

change

in

the

architecture

of

dataflow

machines

-LSB-

-RSB-

However

the

universality

of

the

array

is

not

as

attractive

as

it

seems

at

first

sight

because

not

all

mapped

algorithms

use

the

array

efficiently

The

reasons

for

this

were

analyzed

in

Section

The

efficiency

can

be

improved

by

changing

array

architecture

-LSB-

-RSB-

For

instance

wires

and

programmable

switches

can

be

inserted

into

the

array

allowing

data

to

travel

either

from

processor

to

switch

from

one

switch

to

another

or

from

a

switch

to

a

processor

Another

architectural

modification

creates

blocks

of

processors

-LRB-

characterized

by

tighter

coupling

-RRB-

and

improves

the

array

connectivity

by

insertion

of

wires

and

switches

between

blocks

Although

further

architectural

improvements

of

the

array

may

be

possible

the

area

of

mapping

techniques

is

a

more

likely

source

for

improvements

This

is

illustrated

in

Table

Table

Architectural

vs.

algorithmic

improvements

Improvements

Chip

size

Architectural

Mapping

RungeKutta

EvenProcess

array

wires

array

blocks

array

NS

array

TR

array

PR

array

SA

For

example

if

wires

and

switches

are

inserted

into

the

array

then

the

chip

size

needed

to

host

the

RungeKutta

program

is

If

however

blocks

are

created

the

chip

size

is

only

-LSB-

-RSB-

-LRB-

Results

are

normalized

by

the

relative

sizes

for

the

processors

in

each

architecture

considered

with

the

area

of

the

processor

described

in

-LSB-

-RSB-

-RRB-

On

the

other

hand

if

enhanced

mappings

NS

TR

PR

and

SA

are

used

instead

of

architectural

improvements

the

chip

sizes

are

and

respectively

Conclusions

This

paper

analyzes

a

particular

mapping

scheme

from

-LSB-

-RSB-

which

can

be

used

to

map

arbitrary

parallel

algorithms

onto

message

passing

multiprocessors

with

mesh

topologies

It

shows

that

algorithms

mapped

by

this

scheme

generally

use

too

many

processors

for

communication

purposes

As

a

result

mapped

algorithms

exhibit

serious

drawbacks

such

as

slow

execution

while

at

the

same

time

occupying

an

excessive

area

of

the

target

machine

Our

paper

extends

the

scheme

in

two

key

ways

First

of

all

it

describes

three

algorithmic

improvements

of

the

scheme

It

also

shows

that

they

must

be

implemented

in

a

heuristic

way

since

they

require

solutions

of

certain

NP-complete

problems

Second

the

paper

presents

a

heuristic

method

that

is

used

to

refine

the

results

of

the

mapping

scheme

Four

implementations

of

the

method

are

described

yielding

four

refinement

procedures

Enhanced

mapping

schemes

can

be

obtained

by

appending

any

of

these

procedures

to

the

original

scheme

The

enhanced

mapping

schemes

have

been

experimentally

evaluated

As

a

target

computer

we

used

a

data-driven

processor

array

capable

of

executing

arbitrary

algorithms

We

have

shown

that

the

efficiency

of

the

array

may

be

considerably

improved

by

using

enhanced

mapping

schemes

In

particular

we

have

achieved

savings

in

processors

and

at

the

same

time

savings

in

execution

time

on

average

Thus

the

improved

performance

of

the

array

makes

its

universality

much

more

attractive

References

-LSB-

-RSB-

S.

H.

Bokhari

On

the

mapping

problem

IEEE

Trans

Comput

-LRB-

-RRB-

-LRB-

March

-RRB-

-LCB-

-LSB-

-RSB-

H.-A

Choi

and

B.

Narahari

Efficient

algorithms

for

mapping

and

partitioning

a

class

of

parallel

computations

J.

Parallel

Distributed

Comput

-LRB-

-RRB-

-LRB-

Dec.

-RRB-

-LCB-

-LSB-

-RSB-

J.

B.

Dennis

Dataflow

supercomputers

IEEE

Computer

-LRB-

-RRB-

-LRB-

Nov.

-RRB-

-LCB-

-LSB-

-RSB-

K.

Fukunaga

S.

Yamada

and

T.

Kasai

Assignment

of

job

modules

onto

array

processors

IEEE

Trans

Comput

-LRB-

-RRB-

-LRB-

July

-RRB-

-LCB-

-LSB-

-RSB-

M.

R.

Garey

and

D.

S.

Johnson

Computers

and

intractability

A

guide

to

the

theory

of

NP-completeness

-LRB-

W.

H.

Freeman

and

Co.

-RRB-

-LSB-

-RSB-

I.

Koren

G.

M.

Silberman

A

direct

mapping

of

algorithms

onto

VLSI

processing

arrays

based

on

the

data

flow

approach

in

Proc

Int

Conf

Parallel

Processing

-LRB-

Aug.

-RRB-

-LCB-

-LSB-

-RSB-

I.

Koren

B.

Mendelson

I.

Peled

and

G.

M.

Silberman

A

data-driven

VLSI

array

for

arbitrary

algorithms

IEEE

Computer

-LRB-

-RRB-

-LRB-

Oct.

-RRB-

-LCB-

-LSB-

-RSB-

O.

Kraemer

and

H.

Muehlenbein

Mapping

strategies

in

message-based

multiprocessor

systems

Parallel

Comput

-LRB-

-RRB-

-LRB-

-RRB-

-LCB-

-LSB-

-RSB-

P.

J.

van

Laarhoven

and

E.

H.

L.

Aarts

Simulated

annealing

theory

and

applications

-LRB-

Kluwer

Academic

Press

-RRB-

-LSB-

-RSB-

C.

Lee

and

L.

Bic

Comparing

quenching

and

slow

simulated

annealing

on

the

mapping

problem

in

Proc

Annual

Parallel

Proc

Symp

-LRB-

March

-RRB-

-LCB-

-LSB-

-RSB-

L.

M.

Patnaik

and

R.

Govindarajan

and

N.

S.

Ramadoss

Design

and

performance

evaluation

of

EXMAN

An

EXtended

MANchester

data

flow

computer

IEEE

Trans

Comput

-LRB-

-RRB-

-LRB-

March

-RRB-

-LCB-

-LSB-

-RSB-

B.

Robi

c

P.

Kolbezen

and

J.

Silc

Area

optimization

of

dataflow-graph

mappings

Parallel

Comput

-LRB-

-RRB-

-LRB-

March

-RRB-

-LCB-

-LSB-

-RSB-

P.

Sadayappan

and

F.

Ercal

Nearest-neighbor

mapping

of

finite

element

graphs

onto

processor

meshes

IEEE

Trans

Comput

-LRB-

-RRB-

-LRB-

Dec.

-RRB-

-LCB-

-LSB-

-RSB-

S.

Weiss

I.

Y.

Spilinger

and

G.

M.

Silberman

Architectural

improvements

for

a

datadriven

VLSI

processing

array

J.

Parallel

Distributed

Comput

-LRB-

-RRB-

-LRB-

Dec.

-RRB-

-LCB-

distributed memory message passing multiprocessor


University of Leeds SCHOOL OF COMPUTER STUDIES RESEARCH REPORT SERIES Report 95.26 Automated Pivot Location for the Cartesian-Polar Hybrid Point Distribution Model by Tony Heap & David Hogg Division of Artificial Intelligence August 1995 Abstract The Point Distribution Model -LRB- PDM -RRB- has already proved useful for many tasks involving the location or tracking of deformable objects . A principal limitation is that non-linear variations must be approximated by combining linear variations , which sometimes results in a non-optimal model producing implausible object shapes . The Cartesian-Polar Hybrid PDM helps to overcome this limitation ; selective use of polar geometry allows bending or pivotal deformation to be modelled more accurately ; model components which exhibit no such trend remain in the Cartesian domain . Use of the Hybrid PDM currently requires the identification of pivot points by hand . In this paper we present a method for automatically identifying rigid model parts and pivot points from the training data . Experimental results are given for real data from human hands and for synthetic data from a simple jointed object . 1 Introduction Models are used widely in computer vision ; image features can be located , tracked or classified using a priori knowledge of object shape . Many objects are non-rigid , and thus require some sort of deformable model in order to capture shape variability . One such model is the Point Distribution Model -LRB- PDM -RRB- -LSB- 1 -RSB- , which has already been used as the basis for several vision applications -LSB- 2 , 3 , 4 , 5 , 6 -RSB- . An object is modelled in terms of landmark points positioned strategically on object features , and at regular intervals in between . By extracting such points from a set of training examples of the object , a statistical approach can be used to discover the mean object shape , and the major modes of shape variation . The standard PDM is based purely on linear statistics ; for any particular mode of variation , the positions of landmark points can vary only along straight lines . Non-linear variation is achieved by combining two or more modes . This situation is not ideal , firstly because the most compact representation of shape variability is not achieved , and secondly because implausible shapes can be generated , due to the incorrect assumption that the variation modes are independent . The effect is particularly bad when the object being modelled can bend or pivot . Attempts have been made to combat this problem . The Polynomial Regression PDM -LSB- 7 -RSB- allows landmark points to move along combinations of polynomial paths ; however the computational complexity required is high , and structures experiencing large amounts of pivotal or bending motion still cause problems . 1 The Cartesian-Polar Hybrid PDM -LSB- 8 -RSB- helps to overcome these limitations . By selectively reparameterizing landmark points into polar coordinates , bending and pivotal deformation can be ` linearized ' and thus modelled more accurately . For maximum flexibility , polar-mapped points are allowed to pivot about any other model point , with an axis fixed by a third point ; thus pivot chains are possible . One of the major strengths of the standard PDM is that training is fully automatic -LRB- apart from landmark point generation -RRB- . The Hybrid PDM requires landmark points to be classified as either Cartesian or polar , and polar points must have a pivot and axis reference chosen . This can be done by hand but ideally it should be automated . We previously used a classification algorithm which found mappings by maximizing the model 's ` compactness ' , -LRB- measured quantitatively -RRB- -LRB- see -LSB- 8 -RSB- for details -RRB- . This worked well , but assumed that all the necessary pivot points had been marked on the training examples , which is not always the case . In this paper we propose a new classification method which discovers any pivotal deformation present via statistical analysis of the training data , and automatically inserts pivot points on training examples as and when required . We show the algorithm operating on real data , and use synthetic data to study the system 's robustness to varying input data . 2 The Point Distribution Model A PDM is built purely from the statistical analysis of a number of examples of the object to be modelled -LSB- 1 -RSB- . Given a collection of training images of an object , the Cartesian coordinates of N strategically-chosen landmark points are recorded for each image . Training example e is represented by a vector xe = -LRB- xe1 ; ye1 ; : : : ; xeN ; yeN -RRB- -LRB- for a 2D model -RRB- . The examples are aligned -LRB- translated , rotated and scaled -RRB- using a weighted least squares algorithm , and the mean shape x is calculated by finding the mean position of each landmark point . The modes of variation are found using Principal Component Analysis -LRB- PCA -RRB- on the deviations of examples from the mean , and are represented by N ` variation vectors ' vj . An object shape x is generated by adding linear combinations of the t most significant variation vectors to the mean shape : x = x + tX j = 1 bjvj -LRB- 1 -RRB- where bj is the weighting for the jth variation vector . By ensuring t o N , we extract only the important deformations , discarding training data noise , and thus we can compactly capture object shape and variation . In most cases , deformation is restricted to plausible shapes , making the PDM an ideal tool for robust location or tracking of non-rigid ob - 2 jects . However , the linear nature of the PDM can limit its usefulness ; models are not as compact as they could be , and implausible shapes can occur . 3 The Cartesian-Polar Hybrid PDM The Cartesian-Polar Hybrid PDM provides an improvement on the standard PDM for objects where significant pivoting or bending occurs . Before PCA is performed , landmark points which appear to pivot about some other landmark point are mapped into polar coordinates , with the suspected pivot point as origin and a third point chosen sensibly to provide an axis reference . Landmark points which have no such angular behaviour remain in Cartesian form . In this way , what was a non-linear variation has become linear simply by altering its coordinate frame . Full details of the process are given in -LSB- 8 -RSB- , however two important points should be noted : ffl The hybrid model does not in any way constrain the allowable shapes ; polar-mapped points are still able to vary in two dimensions , hence the hybrid model is more than just a simple articulated model . ffl The increase in computation time is small ; for example , to generate an instance of the anglepoise lamp as shown below required 221105 machine cycles using a Hybrid PDM , compared to 215621 cycles for the standard PDM -LRB- an increase of 2.5 % -RRB- . The Hybrid PDM performs well in practice . Figures 1 and 2 show how the two models compare when used to represent the variation of an anglepoise lamp . Figure 1 : The first four modes of variation under the standard PDM Statistically , the Hybrid PDM was more compact . Mapping points into the polar domain for the anglepoise removed 58.5 % of the variation as represented by the standard PDM , suggesting that in this case the Hybrid PDM was at least twice as compact . 3 Figure 2 : The first four modes of variation under the Hybrid PDM 4 Automatic Pivot Generation The Hybrid PDM requires model landmark points to be classified as being represented in either the Cartesian or polar domain , and in the polar case , a choice of origin and axis is also needed . In order to make the Hybrid PDM useful in the general case , this process should be automated . The technique suggested here uses statistical analysis of the training data to spot trends in the movement of points . Broadly speaking , if a point appears to move in an arc then it should be classified as polar , and its centre of rotation marked . To allow for chains of pivots this idea is extended ; polar movement relative to other points or sets of points is detected . The method employed is to construct groups of points which appear to represent different roughly-rigid parts of the object , and look for pivotal relationships between pairs of groups . 4.1 Finding Rigid Groups of Points We are interested in finding groups of landmark points which appear to be rigid in the sense that they appear to ` move together ' over the training set . In order to achieve this , we first calculate the N by N normalized distance variance matrix D for the training set , where : -LSB- D -RSB- ij = VarjEe = 1 @ q -LRB- xej ? xei -RRB- 2 + -LRB- yej ? yei -RRB- 2 Se 1 A -LRB- 2 -RRB- where Var is the variance operator , and Se is a measure of the overall size of example e , given by : Se = 1 E NX i = 1 NX j = 1 q -LRB- xej ? xei -RRB- 2 + -LRB- yej ? yei -RRB- 2 -LRB- 3 -RRB- A small value for -LSB- D -RSB- ij indicates that points i and j move together over the training set . Hence we can use D as a basis for ` growing ' rigid groups as follows : 1 . Each point starts off as a singleton group . 4 2 . For each group , an attempt is made to add a new point . If G is the set of points in the group under consideration , then we choose the point k 62 G which minimizes Sk in : Sk = max -LRB- dijji ; j 2 G -LSB- fkg -RRB- -LRB- 4 -RRB- If Sk is below a fixed threshold then point k is added to the group , otherwise no point is added . 3 . Remove any duplicate groups formed as a result of step 2 . 4 . Iterate steps 2 and 3 until groups have stopped growing . 5 . Finally , groups with two points or less are discarded . It follows that any points which do not form part of a rigid area are not assigned a grouping , and are excluded from the pivot search . The threshold used for grouping is deliberately set quite tight , making groups smaller than they might otherwise be ; two groups which should ideally be one can be merged later when they are discovered to have a similar pivot point , but one group which should ideally be two can give poor results at the pivot-finding stage . The use of thresholding can , in some cases , cause problems , since different model components often require different thresholds for good results . For example , in objects such as the human hand , which consist of a large main body -LRB- eg . the palm -RRB- and smaller , pivoting sections -LRB- eg . the fingers , and in particular the thumb , which has two separate rigid portions -RRB- , a larger threshold is generally required for the main body than for the smaller sections . The method we use to combat this involves a three-stage process : 1 . The training set is aligned using a weighted least squares technique -LSB- 1 -RSB- -LRB- the same alignment process is used prior to PCA in the training process -RRB- . Points whose standard deviation from their mean position is less than a fixed threshold -LRB- 1.5 % of the model size -RRB- are deemed fairly static and are thus included in a base group of points . 2 . Group-growing is then performed using the subset of points not in the base group . 3 . When the iteration has converged , base group points are reintroduced , and the iterative process is again allowed to converge . This final step allows overlap between the base group and other groups . 5 4.2 Finding Potential Pivots Between Groups Having identified rigid groups of landmark points , the next step is to find plausible pivot points and augment training examples with additional landmarks at the pivots . Pivot points will generally have different coordinates in each training example . Even if we globally align the examples , pivots in chains will not occupy a fixed position . It is therefore necessary to construct a local coordinate frame for each rigid group in each training example , such that points in the group are roughly static in local coordinates over all training examples . We can look for static pivot points in the local coordinate frames , and then map them back into global coordinates . The details of the procedure are as follows : 1 . For each group g in each training example e , we must find a suitable coordinate frame transformation Cg ; e = -LRB- sg ; e ; tg ; e ; pg ; e ; qg ; e -RRB- , where a point -LRB- x ; y -RRB- in local coordinates is transformed onto -LRB- x0 ; y0 -RRB- in global coordinates by : B @ x0 y0 1 1 CA = B @ pg ; e ? qg ; e sg ; e qg ; e pg ; e tg ; e 1 1 CA B @ x y 1 1 CA -LRB- 5 -RRB- The transformation matrix in -LRB- 5 -RRB- is labelled Rg ; e. For each group g , we perform a least squares alignment -LSB- 1 -RSB- of its member points over the training set . Rg ; e is defined as the inverse of the transformation required to align example e. 2 . For each pair of groups a and b , the best pivot point is found . We define this point to be at -LRB- ua ; va -RRB- in a 's local coordinates and at -LRB- ub ; vb -RRB- in b 's local coordinates . Ideally , for each training example , these two points would transform onto roughly the same global position , ie . if Rg ; e -LRB- ug ; vg ; 1 -RRB- T = -LRB- ueg ; veg ; 1 -RRB- T then 8e : -LRB- uea ; vea -RRB- ss -LRB- ueb ; veb -RRB- . Hence we find the values for ua , va , ub and vb which minimize E , the sum of the squares of the distances between the pairs of global coordinates : E = EX e = 1 -LRB- ueb ? uea -RRB- 2 + -LRB- veb ? vea -RRB- 2 -LRB- 6 -RRB- Using -LRB- ueg ; veg ; 1 -RRB- T = Rg ; e -LRB- ug ; vg ; 1 -RRB- T , we obtain : E = EX e = 1 -LRB- -LRB- pb ; eua ? qb ; evb + sb ; e -RRB- ? -LRB- pa ; eua ? qa ; eva + sa ; e -RRB- -RRB- 2 + -LRB- -LRB- qb ; eua + pb ; evb + tb ; e -RRB- ? -LRB- qa ; eua + pa ; eva + ta ; e -RRB- -RRB- 2 -LRB- 7 -RRB- 6 To minimize E , we equate the partial derivatives @E = @ua , @E = @va , @E = @ub and @E = @vb to zero , and hence obtain four simultaneous linear equations , the solution of which simplifies to : -LRB- ua ; va ; ub ; vb -RRB- T = EX e = 1 -LRB- JTe Je + KTe Ke -RRB- ? 1 EX e = 1 -LRB- sb ; e ? sa ; e -RRB- Je + -LRB- tb ; e ? ta ; e -RRB- Ke -LRB- 8 -RRB- where Je = -LRB- pa ; e ; ? qa ; e ; pb ; e ; ? qb ; e -RRB- and Ke = -LRB- qa ; e ; pa ; e ; qb ; e ; pb ; e -RRB- . From here , the pivot point in global coordinates -LRB- ca ; b ; e ; da ; b ; e -RRB- can be found for each training example e by transforming the two points into global coordinates and averaging them : ca ; b ; e da ; b ; e ! = 1 2 uea vea ! + ueb veb !! -LRB- 9 -RRB- The variability Va ; b of the pivot can be measured as the average separation of these two points over the training set , when mapped into global coordinates : Va ; b = 1 E EX i = 1 q -LRB- ueb ? uea -RRB- 2 + -LRB- veb ? vea -RRB- 2 -LRB- 10 -RRB- 3 . A pivot is declared between groups a and b if all of the following are true : ffl The variability Va ; b of the pivot is less than 5 pixels . ffl The standard deviation of the distribution of angles between the coordinate frames for a and b over the training set is at least 5o . ffl The normalized deviation -LRB- standard deviation divided by mean -RRB- in the distribution of the size ratios of the two coordinate frames is less than 0.1 -LRB- ie . the relative size of the two groups remains fairly constant -RRB- . The thresholds have been chosen to be tolerant , as false pivots can still be rejected in the final stage . 4.3 Constructing the Pivotal Structure Once we have found a set of potential pivots , we need to construct a mapping for use by the Hybrid PDM , noting that the formulation of polar mappings relies on having no cyclic dependencies amongst points . Hence , groups are organized into one or more tree-like structures , where child groups pivot off parent groups , and the root group -LRB- s -RRB- provide -LRB- s -RRB- a relatively stable reference . 7 The algorithm we have implemented caters for most cases ; a single tree is constructed . The root is taken to be the largest rigid group found , and a breadth first search is used to attach child groups which have a common pivot with the parent group . Using the breadth first search ensures that a structure is found with the shortest pivotal chains . The point mapping is then constructed in an obvious fashion ; points which are in a group with no parent -LRB- ie . at the tree root or not included in the tree -RRB- , and points in no group , are assigned a Cartesian mapping . Points in parented groups are assigned a polar mapping . New landmark points are generated in all training examples to represent the pivot points , as described in 4.2 above . If a new pivot is consistently sufficiently close -LRB- 5 pixels -RRB- to any existing landmark point , it is removed and the existing point used instead . A suitable point from the parent group is chosen as an axis reference point . 5 Results and Discussion Results are presented for experiments using training data from human hands . Thirty training examples were captured , all of hands positioned with the palm down and fingers outstretched , and the positions of 61 landmark points were extracted from each one . Figure 3 summarizes the results . -LRB- c -RRB- -LRB- d -RRB- 1 2 -LRB- a -RRB- 3 -LRB- b -RRB- 4 5 6 Figure 3 : Automatic pivot generation for a hand model Plot -LRB- a -RRB- shows how the points have been grouped and plot -LRB- b -RRB- shows the pivot points thus generated . Each finger has a single group , and the thumb has been split into two groups , giving two rigid sections . Points near the wrist have failed to be grouped because the angle of the wrist varies significantly over the training set , and the groups produced were deemed too small to be significant enough for pivoting . All pivots -LRB- 1 to 6 -RRB- have been placed roughly where we would expect them ; the pivotal structure of the thumb is such that pivot 6 is parented by pivot 5 . Plots -LRB- c -RRB- and -LRB- d -RRB- show examples of the variation modes produced after training using the annotated data . Pivotal motion is clearly visible , especially in the thumb . These results are encouraging ; the natural structures present in the human hand have been discovered accurately , and the pivot points have been 8 positioned roughly as expected . Quantitative data has been obtained in a second experiment . A synthetic model was constructed , comprising a fixed body and a pivoting arm -LRB- see Figure 4 -RRB- . Training sets were constructed with each example having the arm pivoted at a different angle , and with additive Gaussian noise applied to each landmark point . The idea was to study the accuracy of finding the pivot point whilst varying the following input parameters : ffl The range of angles of the pivoted arm -LRB- a Gaussian distribution with standard deviation of oea degrees -RRB- . ffl The amount of noise used to displace landmark points -LRB- additive Gaussian , with standard deviation oen -RRB- . ffl The number of training examples used , E. ffl The total number of landmark points in the model , P = 6n ? 4 . n pivot point points pointsn Figure 4 : A synthetic model of an object with a single pivot Running the pivot finder on the synthetic data produces the coordinates of a single pivot . The distance of this pivot from ground truth can be calculated as a measure of accuracy . Several hundred trials were performed for each choice of parameters to give the mean output noise with tight confidence limits . The angle range oea is an inherent property of the object being modelled and the noise oen is dependent on the accuracy of the image capture technique . Figure 5 -LRB- a -RRB- shows how they both affect accuracy of the pivot position -LRB- control values used were P = 32 and E = 20 -RRB- . As expected , the accuracy decreases as the angle decreases , and as the level of noise increases . The remaining parameters E and P can be seen as measures that could be employed to improve accuracy . As can be seen in Figure 5 -LRB- b -RRB- , accuracy improves with an increase in both the training set size and the number of points -LRB- control values used were oen = 3 pixels and oea = 8o -RRB- . More specifically , increasing the training set size will only help to a certain extent -LRB- in this example , above 25 examples there is little improvement -RRB- , but increasing the number of points per example gives a more steady increase in performance . 9 0.5 1 1.5 2 2.5 3 3.5 2 6 10 14 18 5 10 15 20 25 10 20 30 40 50 20 32 44 56 68 80 92 104 116 2 4 6 8 10 12 -LRB- a -RRB- input noise s.d. , ns -LRB- pixels -RRB- angle range s.d. , -LRB- b -RRB- s training set a -LRB- degrees -RRB- mean output noise -LRB- pixels -RRB- -LRB- pixels -RRB- mean output noise size , E points per example , P Figure 5 : Pivot location accuracy under varying conditions of -LRB- a -RRB- input noise and angle range ; -LRB- b -RRB- training set size and number of points per training example . 6 Conclusions We have presented a method which improves the usefulness of the CartesianPolar Hybrid PDM . We can automatically discover pivotal motion present in training examples , augment training examples with the necessary pivot points , and correctly classify model landmark points as either Cartesian or polar mapped . The motivation for this work is in anticipation of modelling human hands in 3D using PDMs ; the standard PDM would be unsuitable for modelling the non-linearity present in , for example , the bending of the fingers . The automated Hybrid PDM should provide a better alternative . There are improvements we would like to make to the system ; in particular , the construction of the pivot ` tree ' is based on a very simple breadth-first search algorithm , in which only one group can act as a root . This caters for most cases , but objects with several distinct pivoting structures will cause problems . Also , the manner in which the various thresholds are fixed rigidly is unsatisfactory ; a method requiring no thresholding would be preferable in order to cope with a wider range of tasks . Acknowledgements This work is supported by an EPSRC grant . Thanks are due to members of the Leeds University Vision Group for general help and ideas . References -LSB- 1 -RSB- T.F. Cootes , C.J. Taylor , D.H. Cooper , and J. Graham . Training models of shape from sets of examples . In Proc . BMVC , pages 9 -LCB- 18 , Leeds , UK , 1992 . Springer-Verlag . 10 -LSB- 2 -RSB- A. Hill , T.F. Cootes , and C.J. Taylor . A generic system for image interpretation using flexible templates . In Proc . BMVC , pages 276 -LCB- 285 , Guildford , UK , 1993 . BMVA Press . -LSB- 3 -RSB- A. Hill , A. Thornham , and C.J. Taylor . Model-based interpretation of 3D medical images . In Proc . BMVC , pages 339 -LCB- 348 , Leeds , UK , 1992 . Springer-Verlag . -LSB- 4 -RSB- A. Lanitis , C.J. Taylor , and T.F. Cootes . A generic system for classifying variable objects using flexible template matching . In Proc . BMVC , pages 329 -LCB- 338 , Guildford , UK , 1993 . BMVA Press . -LSB- 5 -RSB- A. Baumberg and D. Hogg . Learning flexible models from image sequences . In Proc . 3rd ECCV , pages 299 -LCB- 308 , Stockholm , Sweden , 1993 . Springer-Verlag . -LSB- 6 -RSB- A.J. Heap . Real-time hand tracking and gesture recognition using Smart Snakes . In Proc . Interface to Human and Virtual Worlds , Montpellier , France , June 1995 . -LSB- 7 -RSB- P.D. Sozou , T.F. Cootes , C.J. Taylor , and E.C. Di-Mauro . A non-linear generalisation of PDMs using polynomial regression . In Proc . BMVC , volume II , pages 397 -LCB- 406 , York , UK , 1994 . BMVA Press . -LSB- 8 -RSB- A.J. Heap and D.C. Hogg . Extending the Point Distribution Model using polar coordinates . In Proc . CAIP , Prague , Czech Republic , September 1995 . 11

O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O B I O O O O O O O O O O O O O O O

point distribution model
polar coordinates