Exact

Side

Effects

for

Interprocedural

Dependence

Analysis

Peiyi

Tang

November

Exact

Side

Effects

for

Interprocedural

Dependence

Analysis

Peiyi

Tang

Department

of

Computer

Science

The

Australian

National

University

Canberra

ACT

Australia

November

Abstract

Exact

side

effects

of

array

references

in

subroutines

are

essential

for

exact

interprocedural

dependence

analysis

To

summarize

the

side

effects

of

multiple

array

references

a

collective

representation

of

all

the

array

elements

accessed

is

needed

So

far

all

existing

forms

of

collective

summary

of

side

effects

of

multiple

array

references

are

approximate

In

this

paper

we

present

a

method

to

represent

the

exact

side

effects

of

multiple

array

references

in

the

form

of

the

projection

of

a

single

integer

programming

problem

Since

the

representation

is

collective

it

dramatically

reduces

the

number

of

pairs

of

dependences

checking

compared

with

other

methods

of

exact

interprocedural

analysis

The

representation

of

the

exact

side

effects

proposed

in

this

paper

can

be

used

by

the

Omega

test

to

support

the

exact

interprocedural

dependence

analysis

in

parallelizing

compilers

This

work

was

done

when

the

author

was

on

leave

in

the

Computer

Science

Laboratory

at

the

Research

School

of

the

Physical

Sciences

and

Engineering

of

the

Australian

National

University

and

was

supported

in

part

by

the

Australian

Research

Council

under

Grant

No

and

the

donation

of

Fujitsu

Laboratory

Ltd.

ii

Introduction

One

of

the

challenges

to

the

parallelizing

compiler

technology

for

scientific

programs

is

the

accurate

interprocedural

dependence

analysis

Subroutines

or

procedures

as

the

product

of

structural

and

modular

programming

style

appear

frequently

in

scientific

FORTRAN

programs

Since

almost

all

scientific

programs

operate

on

large

arrays

with

loops

and

subroutines

are

usually

used

to

operate

on

subarrays

subroutine

calls

nested

in

loops

are

very

common

To

parallelize

loops

with

subroutine

calls

the

interprocedural

dependence

analysis

between

all

statements

including

the

call

statements

is

needed

The

major

issue

of

the

interprocedural

dependence

analysis

is

to

determine

the

side

effects

of

subroutine

calls

The

side

effects

of

a

subroutine

call

is

the

set

of

the

elements

of

the

actual

array

read

or

written

by

the

subroutine

There

have

been

many

works

on

approximate

summary

of

side

effects

of

subroutine

calls

Triolet

et

al

-LSB-

-RSB-

use

a

convex

set

to

summarize

the

set

of

array

elements

of

multiple

references

in

a

subroutine

Callahan

and

Kennedy

-LSB-

-RSB-

use

regular

sections

for

summaries

Halvak

and

Kennedy

-LSB-

-RSB-

extend

and

sharpen

the

regular

sections

with

bounded

regular

sections

Balasundaram

and

Kennedy

-LSB-

-RSB-

use

simple

sections

for

side

effects

summary

All

these

forms

of

summary

are

approximate

For

instance

the

exact

write

side

effects

on

array

B

of

the

call

statement

in

program

in

Figure

-LRB-

a

-RRB-

with

J

is

shown

in

Figure

-LRB-

a

-RRB-

The

approximate

summaries

of

the

side

effects

by

convex

sets

regular

sections

and

simple

sections

are

illustrated

in

Figure

-LRB-

b

-RRB-

-LRB-

c

-RRB-

and

-LRB-

e

-RRB-

respectively

Approximate

summaries

make

conservative

estimations

of

the

side

effects

They

may

contain

the

array

elements

which

are

not

accessed

by

the

subroutine

call

and

cause

false

data

dependences

which

do

not

exist

False

dependencies

reduce

the

amount

of

parallelism

detected

and

introduce

unnecessary

data

synchronization

or

communication

between

parallel

processors

A

common

belief

behind

these

approximate

summaries

is

that

exact

data

dependence

tests

are

too

expensive

to

use

in

practice

The

recent

works

by

W.

Pugh

on

the

exact

Omega

dependence

test

-LSB-

-RSB-

showed

that

by

using

the

equalities

elimination

the

modified

Fourier-Motzkin

variable

elimination

and

other

enhancement

techniques

such

as

redundant

constraints

elimination

the

exact

Omega

dependence

test

is

competitive

with

inexact

analysis

algorithms

for

real

programs

The

efficiency

of

the

Omega

test

has

brought

the

exact

interprocedural

dependence

analysis

back

on

the

agenda

To

support

the

exact

interprocedural

dependence

analysis

an

exact

representation

of

the

side

effects

of

subroutine

calls

is

necessary

In

this

paper

we

present

a

method

to

represent

the

exact

side

effects

in

the

form

of

the

projection

of

a

single

integer

programming

problem

This

representation

can

be

used

by

the

Omega

test

for

the

interprocedural

dependence

analysis

The

representation

is

exact

in

that

it

contains

and

only

contains

the

array

elements

accessed

It

is

also

collective

in

that

a

single

integer

programming

projection

contains

the

elements

accessed

by

all

the

references

in

the

subroutine

Li

and

Yew

-LSB-

-RSB-

proposed

to

use

atom

images

and

atoms

to

summarize

array

side

effects

in

subroutines

While

the

atom

images

and

atoms

are

exact

they

are

not

collective

Each

reference

in

the

subroutine

has

an

atom

image

and

becomes

an

atom

after

PROGRAM

REAL

B

-LRB-

-RRB-

DO

J

CALL

TOUCH

-LRB-

B

J

-RRB-

DO

I

J

B

-LRB-

I

I

-RRB-

CONTINUE

CONTINUE

END

-LRB-

a

-RRB-

Loop

SUBROUTINE

TOUCH

-LRB-

A

N

K

-RRB-

REAL

A

-LRB-

N

N

-RRB-

DO

I

K

B

-LRB-

I

-RRB-

B

-LRB-

I

K

I

-RRB-

CONTINUE

END

-LRB-

b

-RRB-

Subroutine

PROGRAM

REAL

B

-LRB-

-RRB-

DO

J

CALL

TOUCH

-LRB-

B

J

-RRB-

DO

I

B

-LRB-

I

I

-RRB-

CONTINUE

CONTINUE

END

-LRB-

c

-RRB-

Loop

PROGRAM

REAL

B

-LRB-

-RRB-

DO

J

CALL

TOUCH

-LRB-

B

-LRB-

-RRB-

J

-RRB-

DO

I

B

-LRB-

I

I

-RRB-

CONTINUE

CONTINUE

END

-LRB-

d

-RRB-

Loop

Figure

Example

of

Subroutine

Calls

in

Loops

propagated

back

to

the

calling

subroutine

The

number

of

array

references

including

the

atoms

from

the

called

subroutines

is

the

same

as

if

all

the

subroutines

were

in-line

expanded

Therefore

the

number

of

pairs

of

array

references

for

dependence

test

could

be

huge

if

the

call

graph

is

deep

The

number

of

array

reference

pairs

for

dependence

test

are

important

According

to

-LSB-

-RSB-

the

time

for

dependence

analysis

of

a

reference

pair

is

roughly

the

same

as

the

time

for

scanning

array

subscripts

and

loop

bounds

and

forming

and

copying

the

integer

programming

problem

The

collective

representation

of

the

exact

side

effects

proposed

in

this

paper

dramatically

reduces

the

number

of

reference

pairs

for

the

dependence

tests

The

exact

side

effects

in

this

paper

are

obtained

in

two

steps

-LRB-

-RRB-

An

exact

image

that

merges

all

the

images

of

the

references

of

the

formal

array

in

the

subroutine

is

formed

and

-LRB-

-RRB-

the

merged

exact

image

is

propagated

back

to

the

calling

subroutine

to

form

the

exact

side

effects

on

the

actual

array

We

first

describe

the

program

model

and

introduce

notations

in

Section

The

method

of

merging

multiple

images

is

presented

in

Section

The

back

propagation

of

the

merged

image

is

discussed

in

Section

In

section

is

mentioned

in

-LSB-

-RSB-

that

the

dependence

test

time

is

about

times

the

copying

time

The

time

of

scanning

array

subscripts

and

loop

bounds

to

build

the

dependence

problem

is

typically

times

the

copying

cost

For

many

pairs

the

time

of

building

the

problem

is

larger

than

the

time

of

analysis

we

present

the

method

of

using

exact

side

effects

for

exact

interprocedural

dependence

analysis

In

Section

we

discuss

merging

the

exact

side

effects

with

array

reference

images

in

the

calling

subroutine

The

concluding

remarks

and

the

acknowledgement

in

Sections

and

conclude

the

paper

-LRB-

a

-RRB-

Exact

Side

Effects

-LRB-

b

-RRB-

Convex

Sets

Summary

-LRB-

c

-RRB-

Regular

Sections

Summary

-LRB-

d

-RRB-

Simple

Sections

Summary

Figure

Exact

and

Approximate

Side

Effects

Preliminaries

The

program

in

a

subroutine

can

be

regarded

as

a

single

nested

loop

because

the

statements

not

enclosed

in

any

loop

can

always

be

put

in

a

dummy

outermost

loop

with

both

lower

and

upper

loop

bounds

equal

to

We

can

also

assume

that

the

loop

stride

of

each

loop

is

because

any

loop

can

be

normalized

as

such

The

lower

bound

of

each

loop

is

of

the

form

max

-LRB-

e

dEu

ku

e

-RRB-

where

ku

are

positive

integers

and

each

of

Eu

is

an

affine

function

of

the

loop

index

variables

of

the

enclosing

loops

The

constant

term

of

the

function

may

have

integer

formal

parameters

of

the

subroutine

but

the

coefficients

of

the

index

variables

are

integer

constants

Similarly

the

upper

bound

of

each

loop

is

of

the

form

min

-LRB-

c

bHv

kv

c

-RRB-

where

Hv

are

affine

functions

of

the

index

variable

of

the

enclosing

loops

Although

the

loop

bounds

of

such

form

are

rare

in

real

programs

they

are

common

after

the

loops

are

transformed

by

unimodular

transformation

-LSB-

-RSB-

which

incorporates

wide

range

of

loop

transformations

such

as

loop

interchange

loop

skewing

-LSB-

-RSB-

and

loop

permutation

-LSB-

-RSB-

Therefore

a

statement

enclosed

in

n

loops

with

loop

index

variables

in

has

as

many

instances

as

the

integer

grids

in

the

n-dimensional

convex

set

defined

by

the

lower

and

upper

bounds

of

the

enclosed

loops

Each

grid

in

the

convex

set

represents

a

loop

iteration

The

convex

set

can

be

represented

by

f

i

ZnjB

i

bg

where

i

is

the

n-vector

of

index

variables

called

index

vector

B

is

an

integer

matrix

with

n

columns

called

bound

matrix

and

b

is

an

n-vector

called

bound

vector

The

bound

vector

may

have

integer

parameters

In

this

paper

we

assume

that

each

convex

set

defined

by

the

nested

loops

is

non-empty

That

is

there

is

at

lest

one

instance

for

each

loop

body

of

the

nested

loops

For

instance

the

bound

matrix

and

vector

of

the

loop

in

subroutine

TOUCH

in

Figure

-LRB-

b

-RRB-

are

B

b

K

and

we

can

assume

that

K

and

the

convex

set

defined

by

the

loop

is

non-empty

A

reference

of

an

array

say

A

enclosed

in

n

loops

is

of

the

form

A

-LRB-

OEd

-RRB-

where

OEk

k

d

is

an

affine

function

of

the

index

variables

in

of

the

enclosing

loops

OEk

ck

nX

j

fkjij

The

constant

term

ck

may

have

integer

parameters

The

vector

OE

-LRB-

OEd

-RRB-

is

called

subscripts

of

the

reference

and

can

be

expressed

in

the

matrix

form

OE

F

i

c

where

F

is

an

d?n

integer

matrix

F

-LRB-

fkj

-RRB-

called

coefficient

matrix

and

c

is

a

d-vector

c

-LRB-

cd

-RRB-

called

displacement

vector

For

instance

the

coefficient

matrices

and

the

displacement

vectors

for

the

two

references

in

subroutine

TOUCH

are

Now

we

can

define

the

image

of

an

array

reference

in

nested

loops

as

follows

Definition

-LRB-

Image

of

An

Array

Reference

-RRB-

The

image

of

an

array

reference

in

nested

loops

in

a

subroutines

is

the

set

of

the

elements

accessed

by

all

instances

of

the

reference

in

the

nested

loops

I

f

OE

i

Zns

t

OE

c

F

i

B

i

bg

where

i

is

the

index

vector

of

the

enclosing

loops

B

and

b

are

the

bound

matrix

and

vector

of

the

enclosing

loops

and

F

and

c

are

the

coefficient

matrix

and

displacement

vector

of

the

reference

Merged

Image

of

Multiple

References

The

image

of

an

array

reference

defined

in

Definition

is

in

fact

the

projection

of

the

integer

programming

problem

to

the

subspace

spanned

by

-LRB-

OEd

-RRB-

If

there

are

multiple

references

of

an

array

in

the

subroutine

we

need

to

find

a

collective

representation

for

the

union

of

the

images

of

all

the

references

Let

us

concentrate

on

write

references

and

assume

that

there

are

p

write

references

of

formal

array

A

A

-LRB-

OEj

-RRB-

j

p

in

the

subroutine

Let

the

coefficient

matrix

and

displacement

vector

of

the

j-th

-LRB-

j

p

-RRB-

reference

be

Fj

and

cj

respectively

and

the

bound

matrix

and

vector

be

Bj

and

bj

respectively

The

image

of

the

j-th

reference

is

Ij

Clearly

the

image

of

the

multiple

references

is

M

-LSB-

-LSB-

Ip

It

is

not

to

difficult

prove

that

M

can

be

expressed

as

a

disjunction

of

projections

as

follows

M

f

OE

t

OE

ips

t

Bp

ip

bp

OE

cp

Fp

ipg

While

this

representation

is

exact

it

is

not

collective

After

it

is

propagated

back

the

calling

subroutine

it

will

be

intersected

with

other

reference

sets

for

the

dependence

tests

Because

of

the

disjunction

form

of

the

representation

the

intersection

with

another

reference

set

will

also

be

in

the

disjunction

form

This

is

equivalent

to

exporting

multiple

images

like

atom

images

-LSB-

-RSB-

to

the

calling

subroutine

What

we

need

is

an

exact

representation

in

the

form

of

the

projection

of

a

single

integer

programming

problem

The

challenge

is

to

merge

multiple

projections

into

a

single

projection

Ancourt

and

Irigoin

-LSB-

-RSB-

proposed

a

method

to

merge

the

images

of

the

references

with

constant

dependence

distances

between

them

In

our

terms

their

method

only

merges

the

images

of

the

references

with

the

same

coefficient

matrix

Fj

i.e.

Fp

Our

method

is

for

the

general

subscripts

functions

with

different

Fj

Before

introducing

the

integer

programming

projection

for

the

merged

image

of

the

references

we

need

to

clarify

the

notations

for

the

loop

index

vectors

If

two

array

refer

ences

belong

to

the

same

loop

body

they

share

all

their

enclosing

loops

and

therefore

belong

to

the

same

covex

set

Let

there

be

r

r

p

different

convex

sets

defined

by

the

nested

loops

of

the

subroutine

We

use

ijr

to

denote

the

index

vectors

of

the

corresponding

convex

sets

These

vectors

are

independent

although

some

of

them

may

share

some

outer

common

loops

In

the

following

discussion

we

also

use

ij

for

the

index

vector

for

the

j-th

reference

and

each

of

ij

-LRB-

j

p

-RRB-

is

one

of

ijr

For

instance

there

is

only

one

convex

set

defined

by

the

loop

in

subroutine

TOUCH

I

K

and

the

two

references

belong

to

the

same

convex

set

Therefore

and

are

actually

two

notations

of

the

same

vector

We

also

use

-LRB-

ijr

-RRB-

to

denote

the

concatenation

of

vectors

ijr

Let

OEmin

and

OEmax

be

a

pair

of

vectors

such

that

the

following

is

true

for

every

reference

-LRB-

i.e.

j

p

-RRB-

OEmin

Fj

ij

cj

OEmax

for

all

ij

such

that

Bj

ij

bj

-LRB-

-RRB-

We

call

OEmin

and

OEmax

the

common

bound

vectors

of

the

references

Definition

-LRB-

Merged

Image

of

Multiple

References

-RRB-

The

merged

image

of

p

array

references

is

the

set

S

f

OE

Zd

j

-LRB-

ijr

x

-RRB-

njr

ps

t

xp

p

x

pj

ij

bj

pj

OE

Fj

ij

cj

-LRB-

OEmax

OEmin

-RRB-

xj

pj

OE

Fj

ij

cj

-LRB-

OEmin

OEmax

-RRB-

xjg

where

x

-LRB-

xp

-RRB-

is

an

auxilliary

integer

vector

Bj

and

bj

are

the

bound

matrices

and

vectors

Fj

and

cj

are

the

coefficient

matrices

and

displacement

vectors

OEmax

and

OEmin

are

a

pair

of

common

bound

vectors

of

the

references

The

idea

behind

Definition

for

the

merged

image

is

to

introduce

p

integer

variables

xp

between

and

-LSB-

-RSB-

Since

the

sum

of

them

is

p

only

one

variable

can

be

and

the

remaining

variables

must

be

The

following

theorem

shows

that

if

all

the

convex

sets

of

nested

loops

are

non-empty

the

merged

image

is

the

exact

set

of

the

elements

accessed

by

all

the

references

Theorem

If

each

convex

set

defined

by

the

nested

loops

enclosing

a

reference

is

nonempty

the

merged

image

defined

in

Definition

is

the

exact

set

of

the

elements

accessed

by

all

the

references

That

is

S

-LSB-

-LSB-

Ip

Proof

-LRB-

-RRB-

-RRB-

Let

OE

be

an

element

of

S

There

exists

a

-LRB-

ijr

x

-RRB-

njr

p

and

hence

ip

such

that

all

the

constraints

in

the

definition

of

S

are

satisfied

In

particular

Ppj

xj

p

and

xj

-LRB-

j

p

-RRB-

Only

one

of

xj

is

and

all

the

others

are

Let

xk

-LRB-

k

p

-RRB-

and

xj

-LRB-

j

k

-RRB-

Thus

Bk

ik

bk

and

OE

Fk

ik

ck

Since

OEmax

and

OEmin

are

the

upper

and

lower

bounds

of

OE

we

have

OEmin

OE

OEmax

For

other

index

vectors

ij

-LRB-

j

k

-RRB-

OEmin

OE

OEmax

and

Bj

ij

bj

imply

OE

Fj

ij

cj

OEmax

OEmin

and

OE

Fj

ij

cj

OEmin

OEmax

Therefore

these

constrains

for

OE

by

ij

are

reduandant

The

only

non-redundant

constraints

involving

OE

are

OE

Fk

ik

ck

Hence

OE

Ik

and

we

have

S

-LSB-

-LSB-

Ip

-LRB-

-LRB-

-RRB-

Let

OE

be

an

element

of

-LSB-

-LSB-

Ip

Without

loss

of

generality

we

assume

that

OE

Ik

-LRB-

k

p

-RRB-

Thus

there

exists

an

ik

such

that

Bk

ik

bk

and

OE

Fk

ik

ck

This

implies

OEmin

OE

OEmax

Since

all

the

convex

sets

defined

by

the

nested

loops

are

non-empty

there

exists

at

least

one

independent

vector

in

each

of

the

other

convex

sets

Therefore

there

exist

index

vectors

ijr

-LRB-

including

this

ik

-RRB-

such

that

Bj

ij

bj

-LRB-

j

p

-RRB-

For

the

j-th

reference

such

that

j

k

Bj

ij

bj

implies

OEmin

Fj

ij

cj

OEmax

Then

OEmin

OE

OEmax

and

OEmin

Fj

ij

cj

OEmax

imply

OE

Fj

ij

cj

OEmax

OEmin

and

OE

Fj

ij

cj

OEmin

OEmax

We

can

take

xk

and

xj

for

all

j

k

and

conclude

that

OE

S

and

-LSB-

-LSB-

Ip

S.

Notice

that

we

did

not

specify

the

contents

of

OEmax

and

OEmin

in

definition

Theorem

tells

us

that

we

can

use

any

pair

of

vectors

that

satisfy

-LRB-

-RRB-

to

replace

OEmax

and

OEmin

in

the

definition

and

the

resulting

sets

are

all

the

same

-LSB-

-LSB-

Ip

One

convenient

choice

is

the

array

limits

declared

in

the

subroutine

Let

the

array

be

declared

as

A

-LRB-

ld

ud

-RRB-

in

the

subroutine

Each

of

the

limits

lk

or

uk

-LRB-

k

d

-RRB-

can

be

an

affine

function

of

integer

The

vectors

l

BB

ld

CCA

u

BB

ud

CCA

are

called

lower

and

upper

limit

vectors

of

the

array

We

can

assume

that

sequential

programs

at

which

parallelizing

compilers

are

targeted

are

always

correct

and

well-behaved

In

particular

there

should

be

no

array

references

outside

of

the

array

limits

and

therefore

we

can

use

l

and

u

for

OEmin

and

OEmax

respectively

in

the

definition

For

instance

the

low

and

upper

limit

vectors

of

array

A

in

subroutine

TOUCH

are

l

u

N

upper

limit

of

the

last

dimension

ud

can

be

an

assumed

size

denoted

by

a

-LSB-

-RSB-

The

assumed

upper

limit

can

be

regarded

as

a

special

paramenter

which

will

be

replaced

by

the

corresponding

upper

limit

of

the

actual

array

and

the

merged

image

of

the

two

references

in

the

subroutine

is

S

f

-LRB-

-RRB-

j

-LRB-

I

-RRB-

t

I

K

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

N

-RRB-

-LRB-

N

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

N

-RRB-

I

-LRB-

N

-RRB-

When

the

subroutine

is

called

with

N

and

K

the

above

projection

gives

the

exact

side

effects

shown

in

Figure

-LRB-

a

-RRB-

Back

Propagation

of

Merged

Image

The

merged

image

in

Definition

only

defines

the

elements

of

the

formal

array

accessed

by

the

subroutine

It

is

also

symbolic

because

the

integer

programming

problem

may

have

integer

formal

parameters

To

obtain

the

exact

side

effects

on

the

actual

array

the

merged

image

needs

to

be

propagated

back

to

the

calling

subroutine

according

to

the

execution

context

of

the

call

statement

Back

propagation

is

the

process

of

mapping

the

exact

merged

images

to

the

exact

side

effects

on

the

actual

array

The

execution

context

is

the

environment

of

the

call

statement

in

the

calling

subroutine

and

is

defined

by

the

values

of

the

actuals

in

the

call

statement

The

formal

parameters

of

the

subroutine

can

be

divided

into

three

groups

ffl

Array

names

ffl

Integer

parameters

used

in

the

constraints

of

the

merged

image

These

parameters

may

appear

in

vectors

bj

cj

l

and

u.

ffl

Other

parameters

We

do

not

consider

them

here

because

they

do

not

affect

the

back

propagation

of

the

image

The

back

propagation

of

the

image

consists

of

the

following

two

steps

Integer

Parameter

Substitution

In

this

step

the

integer

parameters

in

the

constraints

are

replaced

by

the

actuals

and

the

merged

image

becomes

a

template

of

the

image

Subscript

Translation

The

template

is

translated

to

the

exact

side

effects

on

the

actual

array

according

to

the

actual

for

the

array

name

The

Template

of

the

Merged

Image

Let

z

-LRB-

zw

-RRB-

be

the

integer

parameters

used

in

the

constraints

of

the

merged

image

We

assume

that

the

actual

for

each

integer

parameter

is

an

affine

function

of

variables

or

integer

parameters

in

the

calling

subroutine

Let

these

variables

or

parameters

be

v

-LRB-

vt

-RRB-

These

affine

functions

can

be

represented

by

z

Fz

v

gz

where

Fz

is

a

w

t

constant

integer

matrix

and

gz

is

a

constant

integer

w-vector

For

the

parameters

whose

actuals

are

constants

the

corresponding

rows

of

Fz

are

simply

zero

vectors

For

instance

the

integer

parameters

of

subroutine

TOUCH

are

z

-LRB-

K

N

-RRB-

In

the

call

statements

in

all

the

three

programs

and

in

Figure

-LRB-

a

-RRB-

-LRB-

c

-RRB-

-LRB-

d

-RRB-

the

actual

for

N

is

a

constant

and

the

actual

for

K

is

a

variable

J

Thus

we

have

z

K

N

v

J

Fz

gz

In

the

constraints

of

the

merged

image

the

integer

parameters

z

-LRB-

zw

-RRB-

can

only

appear

in

bj

cj

l

and

u

In

this

paper

we

assume

that

each

of

bj

cj

l

and

u

is

an

affine

function

of

these

parameters

with

constant

coefficients

By

substituting

Fz

v

gz

for

the

parameters

bj

cj

l

and

u

become

the

vectors

which

are

affine

functions

of

v

with

constant

coefficients

Let

them

be

denoted

by

bj

cj

and

respectively

For

instance

these

vectors

in

our

example

are

as

follows

J

The

and

define

the

size

of

the

formal

array

Let

denote

the

subscripts

of

the

formal

array

within

these

limits

Then

the

exact

set

of

the

elements

of

the

formal

array

accessed

for

a

particular

set

of

integer

actuals

can

be

represented

by

the

following

template

of

the

image

Definition

-LRB-

The

Template

of

the

Merged

Image

-RRB-

The

template

of

the

merged

image

is

the

set

defined

by

S

f

Zd

j

-LRB-

ijr

x

-RRB-

njr

p

ws

t

xp

p

x

pj

ij

bj

pj

Fj

ij

cj

-LRB-

-RRB-

xj

pj

Fj

ij

cj

-LRB-

-RRB-

xjg

The

formal

array

with

the

upper

and

lower

limit

vectors

and

is

called

the

template

formal

array

SUBROUTINE

X

-LRB-

A

zw

:-RRB-

REAL

A

-LRB-

ld

ud

-RRB-

END

PROGRAM

MAIN

REAL

B

-LRB-

ld

ud

:-RRB-

CALL

X

-LRB-

B

-LRB-

sd

sd

:-RRB-

:-RRB-

END

-LRB-

a

-RRB-

Subroutine

Call

qM

qM

qM

La

-LRB-

s

-RRB-

qM

La

-LRB-

OE

-RRB-

Template

Array

Actual

Array

Lt

-LRB-

-RRB-

-LRB-

b

-RRB-

Memory

Map

Figure

Subscript

Translation

Subscript

Translation

To

find

the

exact

side

effects

on

the

actual

array

we

need

to

translate

the

subscripts

of

the

template

formal

array

to

those

of

the

actual

array

according

to

the

actual

for

the

array

name

In

general

the

shapes

of

the

formal

and

the

actual

arrays

are

allowed

to

be

different

in

FORTRAN

and

the

subscript

translation

between

them

could

be

complicated

However

in

most

real

FORTRAN

programs

formal

arrays

are

subarrays

of

the

actual

arrays

We

have

the

following

assumptions

regarding

the

shape

of

the

actual

array

Assumption

-LRB-

Shape

of

the

Actual

Array

-RRB-

Given

actual

array

B

The

number

of

dimensions

of

B

is

equal

or

larger

than

that

of

the

formal

array

A.

The

sizes

of

the

first

d

dimensions

of

the

actual

array

B

is

the

same

as

those

of

the

template

formal

array

A

The

size

of

the

d-th

dimension

of

the

actual

array

is

no

less

than

that

of

the

template

formal

array

These

assumptions

should

be

satisfied

in

most

real

FORTRAN

programs

Let

the

actual

array

be

declared

as

B

-LRB-

ld

ud

:-RRB-

in

the

calling

subroutine

Let

the

actual

for

the

array

name

be

B

-LRB-

sd

sd

:-RRB-

The

situation

is

illustrated

in

Figure

-LRB-

a

-RRB-

According

to

Assumption

we

have

uk

lk

mk

k

d

Let

be

and

Mk

mk

Given

an

array

element

in

the

template

formal

array

A

-LRB-

-RRB-

its

location

in

the

memory

map

is

Lt

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

Md

Let

OE

-LRB-

OEd

-RRB-

be

the

first

d

subscripts

of

the

actual

array

Due

to

the

conditions

in

Assumption

the

location

of

the

element

B

-LRB-

OEd

sd

:-RRB-

in

the

memory

map

of

the

actual

array

is

qM

La

-LRB-

OEd

-RRB-

where

q

is

an

integer

determined

by

the

subscripts

in

the

array

name

actual

for

the

dimensions

higher

than

the

d-th

M

is

the

size

of

the

subarray

by

the

first

d

dimensions

and

La

-LRB-

OEd

-RRB-

-LRB-

-RRB-

-LRB-

OEd

ld

-RRB-

Md

The

binding

between

the

formal

array

name

and

its

actual

B

-LRB-

sd

:-RRB-

makes

the

first

element

of

the

the

template

formal

array

be

located

at

location

qM

La

-LRB-

sd

-RRB-

in

the

memory

map

of

the

actual

array

Let

s

be

-LRB-

sd

-RRB-

To

relate

to

OE

we

only

need

to

note

that

Lt

-LRB-

-RRB-

and

qM

La

-LRB-

OE

-RRB-

are

in

the

same

location

of

the

memory

as

shown

in

Figure

-LRB-

b

-RRB-

and

we

have

qM

La

-LRB-

OE

-RRB-

qM

La

-LRB-

s

-RRB-

Lt

-LRB-

-RRB-

-LRB-

-RRB-

Hence

dX

k

-LRB-

OEk

sk

-RRB-

Mk

dX

k

-LRB-

-RRB-

Mk

Thus

-LRB-

OEk

sk

-RRB-

-LRB-

-RRB-

k

d

or

OE

s

-LRB-

-RRB-

Let

ffi

s

The

above

observation

can

be

summarized

in

the

following

lemma

Lemma

If

the

conditions

in

Assumption

are

satisfied

the

subscripts

of

the

template

can

be

translated

to

the

first

d

subscripts

of

the

actual

array

OE

by

OE

ffi

where

ffi

s

and

is

the

lower

limit

vector

of

the

template

formal

array

and

s

is

the

first

d

subscripts

of

the

actual

for

the

array

name

In

our

example

the

assumptions

about

the

actual

array

are

satisfied

in

all

the

three

programs

in

Figure

For

the

subroutine

calls

in

programs

and

ffi

but

for

program

it

is

ffi

Based

on

the

template

of

the

merged

image

and

the

subscript

translation

scheme

the

exact

side

effects

of

a

subroutine

call

can

be

represented

by

an

integer

programming

projection

shown

in

the

following

theorem

Theorem

If

the

conditions

of

Assumption

are

satisfied

the

side

effects

on

the

actual

array

of

an

instance

of

the

call

statement

is

the

set

of

the

elements

of

the

actual

array

whose

subscripts

for

the

dimensions

higher

than

the

d-th

are

-LRB-

sd

:-RRB-

and

the

first

d

subscripts

OE

-LRB-

OEd

-RRB-

are

specified

by

the

following

projection

eS

f

OE

Zd

j

-LRB-

ijr

x

-RRB-

njr

ps

t

xp

p

x

pj

ij

bj

pj

OE

ffi

Fj

ij

cj

-LRB-

u

l

-RRB-

xj

pj

OE

ffi

Fj

ij

cj

-LRB-

l

u

-RRB-

xjg

where

ffi

is

the

same

as

described

in

Lemma

bj

and

cj

are

the

same

as

described

in

Definition

and

l

and

u

are

the

low

and

upper

limit

vectors

for

the

first

d

dimensions

for

the

first

d

dimensions

of

the

actual

array

declared

in

the

calling

subroutine

Proof

The

template

in

Definition

defines

the

exact

set

of

the

elements

of

the

template

formal

array

accessed

by

the

subroutine

The

constraints

involving

are

Fj

ij

cj

-LRB-

-RRB-

xj

and

Fj

ij

cj

-LRB-

-RRB-

xj

According

to

Lemma

OE

ffi

Since

there

are

no

array

references

outside

of

the

array

limits

we

have

l

OE

u.

Hence

l

ffi

u

ffi

According

to

Theorem

we

can

replace

and

with

l

ffi

and

u

ffi

respectively

without

changing

the

elements

defined

by

the

template

The

constraints

become

Fj

ij

cj

-LRB-

u

l

-RRB-

xj

and

Fj

ij

cj

-LRB-

l

u

-RRB-

xj

Further

replacing

the

with

OE

ffi

yields

the

projection

described

in

the

theorem

For

instance

the

exact

side

effects

of

the

instance

of

the

call

statement

with

a

particular

value

of

J

in

program

is

eS

f

-LRB-

-RRB-

j

-LRB-

I

-RRB-

t

I

J

I

Note

that

limit

vectors

of

the

actual

array

are

l

-LRB-

-RRB-

and

u

-LRB-

-RRB-

Exact

Interprocedural

Analysis

The

exact

side

effects

on

the

actual

array

can

be

used

for

the

exact

interprocedural

dependence

analysis

The

Omega

test

is

a

practical

exact

dependence

test

based

on

integer

programming

projection

-LSB-

-RSB-

The

representation

of

the

exact

side

effects

in

this

paper

can

be

used

in

the

Omega

test

The

exact

Omega

dependence

tests

between

array

references

are

covered

in

-LSB-

-RSB-

In

this

section

we

discuss

the

exact

Omega

dependence

tests

between

call

statements

and

array

references

If

a

call

statement

is

enclosed

in

loops

there

could

be

multiple

instances

of

it

The

exact

side

effects

specified

by

Theorem

is

for

a

single

instance

of

the

call

statement

Recall

that

the

actuals

for

the

integer

parameters

of

the

subroutine

z

-LRB-

zw

-RRB-

are

affine

functions

of

variables

or

integer

parameters

of

the

calling

subroutine

v

-LRB-

vt

-RRB-

Let

the

first

y

elements

of

v

vy

-LRB-

vy

-RRB-

are

variables

in

the

calling

subroutine

and

the

rest

are

parameters

The

variables

are

usually

the

index

variables

of

the

enclosing

loops

or

can

be

converted

as

such

-LRB-

e.g.

induction

variables

-RRB-

Let

us

use

eS

-LRB-

vy

-RRB-

to

denote

the

exact

side

effects

of

the

instance

of

the

call

statment

for

a

particular

vy

We

also

assume

that

bound

matrix

and

vector

of

the

enclosing

loops

are

By

and

by

respectively

Hence

the

values

of

the

variables

can

be

represented

by

the

following

convex

set

C

f

vy

ZyjBy

vy

byg

Let

us

concentrate

on

the

dependence

test

between

a

call

statement

and

an

array

reference

The

dependence

test

between

two

call

statements

can

be

worked

out

similarly

Suppose

that

the

subscript

function

for

the

first

d-dimensions

of

an

array

reference

is

F

vx

and

the

function

for

the

remaining

dimensions

is

F

vx

Let

the

bound

matrix

and

vector

of

the

loops

enclosing

the

reference

be

Bx

and

bx

respectively

There

is

a

data

dependence

-LRB-

flow

anti

or

output

-RRB-

between

the

call

statement

and

the

array

reference

if

and

only

if

there

is

an

element

accessed

by

both

and

at

least

one

access

is

a

write

Formally

we

can

have

the

following

definition

Definition

-LRB-

Data

Dependence

-RRB-

There

is

a

data

dependence

between

a

call

statement

and

an

array

reference

if

and

only

if

There

exist

OE

vx

and

vy

such

that

Bx

vx

bx

By

vy

by

OE

eS

-LRB-

vy

-RRB-

OE

F

vx

F

vx

where

is

the

subscripts

of

the

dimensions

higher

than

the

d-th

of

the

actual

for

the

simplify

the

discussion

we

do

not

address

the

issue

of

dependence

killing

and

covering

-LSB-

-RSB-

in

this

paper

array

name

-LRB-

sd

:-RRB-

in

the

call

statement

and

everything

else

are

as

described

in

the

above

discussion

and

Either

the

reference

is

a

write

reference

or

the

side

effects

eS

is

the

write

side

effects

The

following

theorem

shows

how

to

form

an

integer

programming

projection

to

test

the

existence

of

dependences

Theorem

There

is

a

data

dependence

between

a

call

statement

and

an

array

reference

if

and

only

if

the

set

defined

by

the

following

projection

is

non-empty

f

OE

Zd

j

vx

vy

ijr

xs

t

By

vy

by

xp

p

x

pj

ij

bj

pj

OE

ffi

Fj

ij

cj

-LRB-

u

l

-RRB-

xj

pj

OE

ffi

Fj

ij

cj

-LRB-

l

u

-RRB-

xj

Bx

vx

bx

OE

F

vx

F

vx

where

By

by

Bx

bx

F

F

and

are

as

described

in

Definition

and

everything

else

are

as

described

in

Theorem

Either

the

reference

is

a

write

reference

or

the

side

effects

eS

is

the

write

side

effects

For

instance

to

find

out

whether

there

are

dependences

between

the

call

statement

and

the

read

reference

in

program

we

can

use

the

Omega

test

to

determine

whether

the

following

projection

is

non-empty

f

-LRB-

-RRB-

j

-LRB-

I

J

-RRB-

t

I

J

J

I

-LRB-

a

-RRB-

Elements

accessed

by

loop

D

f

-LRB-

-RRB-

j

-LRB-

I

J

-RRB-

t

I

J

J

I

Jg

-LRB-

b

-RRB-

Omega

test

for

loop

-LRB-

c

-RRB-

Elements

accessed

by

loop

D

f

-LRB-

-RRB-

j

-LRB-

I

J

-RRB-

t

I

J

J

I

Jg

-LRB-

d

-RRB-

Omega

test

for

loop

-LRB-

e

-RRB-

Elements

accessed

by

loop

D

f

-LRB-

-RRB-

j

-LRB-

I

J

-RRB-

t

I

J

J

I

Jg

-LRB-

f

-RRB-

Omega

test

for

loop

Figure

Interprocedural

Omega

Tests

To

find

distance

vectors

of

the

dependences

we

only

need

to

project

the

integer

programming

problem

on

the

differences

of

the

index

variables

of

the

common

enclosing

loops

The

details

of

the

technique

can

be

found

in

-LSB-

-RSB-

In

the

above

example

the

distance

vector

is

defined

as

-LRB-

-RRB-

where

J

because

the

call

statement

and

the

assignment

statement

share

only

loop

J

The

integer

programming

projections

for

the

distance

vectors

of

the

dependences

in

programs

and

are

shown

in

Figure

-LRB-

b

-RRB-

-LRB-

d

-RRB-

and

-LRB-

f

-RRB-

respectively

We

have

run

the

exact

Omega

tests

on

these

projections

and

the

results

are

There

are

no

dependences

from

the

call

statement

to

the

assignment

in

program

Therefore

loop

J

can

be

executed

as

a

DOALL

There

are

data

dependences

from

the

call

statement

to

the

assignment

statment

in

program

The

distance

vector

is

-LRB-

-RRB-

-LRB-

-RRB-

Loop

J

has

to

remain

serial

There

are

data

dependences

from

the

call

statement

to

the

assignment

statment

in

program

The

distance

vector

is

-LRB-

-RRB-

-LRB-

-RRB-

Since

the

dependences

do

not

cross

iterations

loop

J

can

be

transformed

to

a

DOALL

loop

These

Omega

tests

were

run

a

Sparc

IPC

Workstation

based

on

the

MIPS

Sun

Sparc

CPU

The

times

for

the

three

tests

are

msecs

msecs

and

msecs

respectively

Figure

-LRB-

a

-RRB-

-LRB-

c

-RRB-

and

-LRB-

e

-RRB-

show

the

elements

of

array

B

accessed

in

programs

and

respectively

when

J

The

shaded

small

squares

show

the

side

effects

of

the

subroutine

call

and

the

round

dark

dots

show

the

elements

read

by

the

assignment

statement

It

can

be

seen

from

these

figures

that

all

the

three

interprocedural

dependence

tests

are

accurate

Notice

that

the

accuracy

of

these

tests

can

not

be

achieved

if

the

approximate

summaries

of

side

effects

shown

in

Figure

were

used

Merging

Side

Effects

and

Reference

Images

We

have

shown

how

to

form

the

exact

side

effects

of

a

subroutine

call

and

use

them

for

interprocedural

dependence

analysis

The

calling

subroutine

can

itself

be

called

by

another

subroutine

Figure

shows

two

subroutines

and

one

main

program

program

MAIN

calls

subroutine

LOOP

which

in

turn

calls

subroutine

TOUCH

To

determine

the

side

effects

on

array

C

of

subroutine

call

in

program

MAIN

both

the

write

reference

of

array

B

and

the

call

statement

in

subroutine

LOOP

need

to

be

considered

We

can

merge

the

side

effects

of

the

subroutine

call

of

TOUCH

with

the

image

of

the

write

reference

The

merged

image

then

can

be

propagated

back

further

to

program

MAIN

The

method

of

merging

side

effects

of

call

statements

with

images

of

array

references

is

similar

to

the

method

of

merging

array

reference

images

described

in

Section

Instead

DOALL

loop

is

a

parallel

loop

whose

iterations

can

be

executed

in

any

order

without

crossiteration

synchronization

or

communication

If

a

loop

does

not

have

dependences

across

its

iterations

it

can

be

transformed

to

a

DOALL

loop

PROGRAM

MAIN

REAL

C

-LRB-

-RRB-

DO

I

CALL

LOOP

-LRB-

C

I

-RRB-

DO

J

I

DO

K

I

C

-LRB-

J

K

-RRB-

CONTINUE

CONTINUE

CONTINUE

END

-LRB-

a

-RRB-

main

program

SUBROUTINE

LOOP

-LRB-

B

M

L

-RRB-

REAL

B

-LRB-

M

M

-RRB-

DO

J

L

CALL

TOUCH

-LRB-

B

M

J

-RRB-

DO

I

J

B

-LRB-

I

-RRB-

CONTINUE

CONTINUE

END

-LRB-

b

-RRB-

Subroutine

LOOP

SUBROUTINE

TOUCH

-LRB-

A

N

K

-RRB-

REAL

A

-LRB-

N

N

-RRB-

DO

I

K

B

-LRB-

I

-RRB-

B

-LRB-

I

K

I

-RRB-

CONTINUE

END

-LRB-

c

-RRB-

Subroutine

TOUCH

Figure

Serial

subroutine

calls

of

going

through

the

theorem

with

formal

notations

we

are

going

to

use

the

example

in

Figure

to

show

the

method

According

to

Theorem

the

exact

side

effects

of

the

subroutine

call

of

TOUCH

is

eS

f

-LRB-

-RRB-

j

-LRB-

I

-RRB-

t

I

J

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

-LRB-

M

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

I

-LRB-

M

-RRB-

Here

J

is

a

variable

and

the

convex

set

for

its

values

is

defined

by

J

L

The

index

vector

for

the

enclosing

loops

of

the

write

reference

is

-LRB-

-RRB-

The

convex

set

for

the

write

reference

is

L

To

merge

the

side

effects

of

all

instances

of

the

call

statement

with

the

image

of

the

reference

we

introduce

and

such

that

and

If

is

used

for

the

reference

and

for

the

side

effects

the

merged

image

is

eS

f

-LRB-

-RRB-

j

-LRB-

I

-RRB-

t

L

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

-LRB-

M

-RRB-

that

the

call

statement

and

the

write

reference

belong

to

the

different

loop

bodies

Therefore

the

index

vectors

for

them

are

different

J

L

I

J

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

-LRB-

-RRB-

I

-LRB-

M

-RRB-

-LRB-

-RRB-

g

The

merged

image

of

the

reference

and

the

side

effects

of

subroutine

call

of

TOUCH

can

be

propagated

back

further

to

program

MAIN

following

the

same

algorithm

described

in

Section

As

we

can

see

the

side

effects

can

be

merged

with

all

the

references

or

other

side

effects

in

the

back

propagations

all

the

way

to

the

entry

of

the

call

graph

We

can

also

choose

to

merge

array

references

only

and

let

the

side

effects

be

propagated

back

alone

For

instance

the

side

effects

of

subroutine

call

of

TOUCH

can

be

further

propagated

back

alone

using

the

following

projection

eS

f

-LRB-

-RRB-

j

-LRB-

I

-RRB-

t

I

J

J

L

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

-LRB-

M

-RRB-

-LRB-

-RRB-

-LRB-

-RRB-

-LRB-

M

-RRB-

I

-LRB-

M

-RRB-

Note

the

constraint

J

L

in

the

above

projection

This

means

that

the

above

projection

represent

the

side

effects

of

all

instances

of

the

call

statement

in

subroutine

LOOP

In

essence

merging

all

references

including

all

side

effects

of

subroutine

calls

and

not

merging

at

all

using

atom

images

-LSB-

-RSB-

are

the

two

extremes

on

the

spectrum

of

the

degree

of

merging

array

side

effects

for

dependence

analysis

To

achieve

the

best

performance

the

balance

between

the

number

of

reference

pairs

for

dependence

test

and

the

size

of

the

projections

for

the

side

effects

need

to

be

determined

We

are

currently

incorporating

the

Omega

test

into

our

system

and

implementing

the

merging

algorithms

of

this

paper

The

experiments

on

real

FORTRAN

programs

to

find

the

cost

of

merging

and

the

best

balance

will

be

carried

out

in

due

course

Concluding

Remarks

We

have

presented

a

method

to

merge

the

images

of

multiple

references

of

arrays

in

subroutines

The

merged

image

is

represented

in

the

form

a

single

integer

programming

projection

and

is

exact

The

idea

is

to

introduce

integer

variables

with

values

or

and

use

the

array

limits

as

the

common

bounds

for

the

references

We

have

presented

the

algorithms

to

propagate

the

merged

image

back

to

the

calling

subroutine

and

form

the

projection

for

the

exact

side

effects

on

the

actual

arrays

We

have

showed

how

the

projection

for

the

exact

side

effects

can

be

incorporated

into

the

Omega

tests

for

the

exact

interprocedural

dependence

analysis

If

the

calling

subroutine

is

itself

called

by

other

subroutines

the

exact

side

effects

can

also

be

merged

with

the

array

references

in

the

calling

subroutine

or

other

side

effects

using

the

extended

method

based

on

the

same

idea

We

are

incorporating

the

Omega

test

into

our

system

to

evaluate

the

performance

for

the

proposed

exact

side

effects

for

interprocedural

analysis

on

real

FORTRAN

programs

The

degree

of

mering

side

effects

will

also

be

investigated

to

find

the

best

balance

between

the

number

of

reference

pairs

and

the

size

of

integer

programming

projections

Acknowledgement

The

Omega

tests

in

this

paper

are

run

on

the

Omega

System

of

W.

Pugh

from

the

University

of

Maryland

I

would

like

to

thank

W.

Pugh

for

making

the

Omega

System

freely

available

for

anonymous

ftp

References

-LSB-

-RSB-

R.

Triolet

F.

Irigoin

and

P.

Feautrier

Direct

Parallelization

of

Call

Statements

Proceedings

of

the

SIGPLAN

Symposium

on

Compiler

Construction

SIGPLAN

Notices

vol

no.

pp.

-LCB-

July

-LSB-

-RSB-

D.

Callahan

and

K.

Kennedy

Analysis

of

Interprocedural

Side

Effects

in

a

Parallel

Programming

Environment

Journal

of

Parallel

and

Distributed

Computing

vol

pp.

-LCB-

-LSB-

-RSB-

P.

Havlak

and

K.

Kennedy

An

Implementation

of

Interprocedural

Bounded

Regular

Section

Analysis

IEEE

Transactions

on

Parallel

and

Distributed

Systems

vol

no.

pp.

-LCB-

July

-LSB-

-RSB-

V.

Balasundaram

and

K.

Kennedy

A

Technique

for

Summarizing

Data

Access

and

Its

Use

in

Parallelism

Enhancing

Transformations

in

Proceedings

of

the

ACM

SIG

PLAN

Conference

on

Programming

Language

Design

and

Implementation

Portland

Orgen

June

pp.

-LCB-

-LSB-

-RSB-

W.

Pugh

The

Omega

Test

a

Fast

and

Practical

Integer

Programming

Algorithm

for

Dependence

Analysis

in

Proceedings

of

Supercomputing

November

pp.

-LCB-

-LSB-

-RSB-

A

Practical

Algorithm

for

Exact

Array

Dependence

Analysis

Communications

of

the

ACM

vol

no.

pp.

-LCB-

August

-LSB-

-RSB-

W.

Pugh

and

D.

Wonnacott

Eliminating

False

Data

Dependences

Using

the

Omega

Test

in

Proceedings

of

the

ACM

SIGPLAN

Conference

on

Programming

Language

Design

and

Implementation

San

Francisco

California

June

pp.

-LCB-

-LSB-

-RSB-

Z.

Li

and

P-C

Yew

Interprocedural

Analysis

for

Parallel

Computing

Proceedings

of

the

International

Conference

on

Parallel

Processing

vol

II

pp.

-LCB-

August

-LSB-

-RSB-

Z.

Li

and

P-C

Yew

Program

Parallelization

with

Interprocedural

Analysis

The

Journal

of

Supercomputing

vol

no

pp.

-LCB-

-LSB-

-RSB-

M.

E.

Wolf

and

M.

S.

Lam

A

Loop

Transformation

Theory

and

an

Algorithm

to

Maximize

Parallelism

IEEE

Transactions

on

Parallel

and

Distributed

Systems

vol

no.

pp.

-LCB-

October

-LSB-

-RSB-

U.

Banerjee

Unimodular

Transformations

of

Double

Loops

in

Advances

in

Languages

and

Compilers

for

Parallel

Processing

Proceedings

of

the

Third

-LRB-

-RRB-

Workshop

on

Languages

and

Compilers

for

Parallel

Computing

A.

Nicolau

D.

Gelernter

T.

Gross

and

D.

Padua

Eds

London

UK

Pitman

pp.

-LCB-

-LSB-

-RSB-

M.

Wolfe

Optimizing

Compilers

for

Supercomputers

Cambridge

MA

MIT

Press

-LSB-

-RSB-

U.

Banerjee

A

Theory

of

Loop

Permutations

in

Proceedings

of

the

Workshop

on

Languages

and

Compilers

for

Parallel

Computing

August

pp.

-LCB-

-LSB-

-RSB-

C.

Ancourt

and

F.

Irigoin

Scanning

Polyhedra

with

DO

Loops

in

Proceedings

of

the

Third

ACM

SIGPLAN

Symposium

on

Principle

and

Practice

of

Parallel

Programming

Wiliamsburg

Virginia

April

pp.

-LCB-

-LSB-

-RSB-

H.

M.

Salkin

Integer

Programming

Addison-Wesley

Publishing

Company

-LSB-

-RSB-

D.

M.

Morno

A

Crash

Course

in

FORTRAN

London

Edward

Arnold

Publishing

Division

of

Hodder

and

Stoughton

Limited

call statements
exact side effects of array references
interprocedural dependence analysis
parallelizing compilers

exact dependence tests
loop parallelization


University of Leeds SCHOOL OF COMPUTER STUDIES RESEARCH REPORT SERIES Report 94.17 An Empirical Study of Video Application Performance over ATM and Ethernet Networks 1 by M Kara , R Drew , N D Hunter , J Jackson P M Dew Division of Computer Science May 1994 1To be presented and to appear in the Proceedings of the Second IFIP Workshop on Performance Modelling and Evaluation of ATM Networks , July 1994 . Abstract Over the past few years , there has been a strong and growing interest in faster network technologies such as FDDI and ATM . However , the perceived throughput at the application level has not always increased accordingly . Various performance bottlenecks have been encountered each of which has to be analysed and corrected . This paper presents a performance evaluation of continuous video data streams over ATM networks and compares them with similar experiments over Ethernet networks . The ATM LAN testbed for these experiments consists of three SG R4000 Indigos workstations connected by ATM Fore first generation interface cards and a Synoptics ATM switch . It is expected that video applications would run faster on ATM networks than Ethernet networks . A preliminary examination suggested to us that data movements through the protocol stack and the processing overheads were considerably high and that with some parameter settings , experiments with Ethernet would perform four to five times better than those with ATM . To address and explore this issue , a packetisation process has been added within the video application that would split each video frame into a number of packets . We show that by implementing a packetisation process at the application level , the end host is able to deliver cells at a faster rate . The sensitivity of these parameters , and also the overheads involved are discussed . The results are consistent over a range of video frame sizes : CIF -LRB- 25K -RRB- , QCIF -LRB- 101K -RRB- , and SCIF -LRB- 405K -RRB- . 1 Introduction The development of faster computer networks means that there is an inadequate performance between conventional network interface architectures and communication protocol implementations . For example , workstation users replacing 10 Mbps Ethernet with 100 Mbps FDDI -LRB- Fiber Distributed Data Interface -RRB- networks are not observing a tenfold increase in application to application throughput -LSB- CJRS89 -RSB- . Asynchronous Transfer Mode -LRB- ATM -RRB- is an emerging communication architecture based on switching and multiplexing small fixed-length packets called cells -LSB- New92 -RSB- . Although ATM was originally developed as an international standard for Synchronous Optical Networks -LRB- SONET -RRB- - based wide-area networks , its attractiveness for local area networks -LRB- LANs -RRB- has resulted in ATM LANs appearing well in advance of WAN ATM-based services -LSB- LMT93 -RSB- . In the local area network , ATM can be used for the following purposes : ffl Workgroup ATM for client/server computing with high performance workstations and servers . ffl Backbone ATM for connecting existing hubs , bridges and routers throughout a campus . ffl LAN/WAN integration - a seamless integration end-to-end digital connection , hence reducing on expensive routers , latency and improving performance . ffl Multimedia Applications - guaranteed bandwidth offered by ATM networks enables the delivery of continuous media -LRB- such as audio and video -RRB- over the network along with other types of traffic such as data . The University of Leeds has recently funded an ATM project -LRB- joint with the University Computing Service -RRB- to advance understanding of desktop-to-desktop ATM and support a number of key applications . The first phase of this project was the installation of a Synoptics -LRB- code -RRB- switch and Fore Systems -LRB- code -RRB- interface cards to Silicon Graphics -LRB- SG -RRB- workstations . The ATM LAN network is an integrable part of a Real-time Collaborative Computing Environment comprising of SG Indy systems and an SG Powerchallenge multi-media server that has recently been installed at Leeds . Three main demonstrator projects of real time collaborative computing are planned : ffl Distributed Virtual Engineering . This project , based in the Keyworth Institute of Manufacturing and Information Systems Engineering will demonstrate the value of ATM networking to support the computing requirements for a distributed team responsible for the maintenance of complex engineering products . ffl Virtual Science Park . This major joint venture between the University , local industry , and local and national suppliers of communications infrastructure and products , will integrate a multi-media database describing the skills located within the University with collaborative tools based on UNIX and PC platforms . ffl Visual Surveillance . This project , led by Professor David Hogg , integrates the real time transmission of video images , the real time construction of a representation of a 3D world from the images , and the real time recognition of moving objects in a sequence of 3D images . A common requirement for these projects is the ability to handle continuous video data streams over ATM . This stream is generated by a video application -LRB- videophone -RRB- . Performance tests carried out over an Ethernet network have indicated an unpredictable and poor performance . Upon the arrival of the first generation of ATM computer interface cards , it was expected to find a noticeable improvement in the performance of the videophone . However , early experiments indicated that performance improvement was not a straight forward task due to the fact that the protocol stacks processing was executed on the host . This paper presents the current progress , recent results and our experiences with video data streams over ATM LANs , and also our experiences in running applications with an ATM LAN network using different signalling protocols . 2 From Ethernet to ATM The experimental ATM LAN network in the School of Computer studies currently consists of three SG R4000 Indigo workstation , each with a FOREATM computer interface -LRB- ForeRunner GIA-100 -RRB- . These three interfaces are connected by a Lattis-Cell 10124 Synoptics ATM Switch -LRB- 16 ports 4B5B TAXI interface -RRB- . The workstations communicate via IP-PVCs -LRB- IP protocol set onto Permanent Virtual Circuits -RRB- due to the incompatibility between FORE and Synoptics signalling protocols . The figure below depicts the experimental environment . Silicon Graphics R4000 with FORE ATM card Silicon Graphics R4000 with FORE ATM card Silicon Graphics R4000 with FORE ATM card Synoptics ATM switch Permanent Virtual Circuits -LRB- PVCs -RRB- The video application has been developed using the interprocess communication facilities available on most Unix platforms -LRB- such as SunOS and IRIX -RRB- that support the University of Berkeley Software Distribution 4.3 BSD.The socket abstraction allows networked applications to be developed independently of the underlying networks and protocols . Several different socket types exist and these provide services that include , in-order , unduplicated and reliable delivery of packets . One of the most demanding aspects of network interface and protocol stack design is the provision of high throughput all the way up the protocol stack to the application . With a conventional network interface , the socket layer and network protocols are implemented entirely in software on the host . Overheads are incurred whenever data is sent or received , because the host is involved in these higher layer protocols . The videophone was tested with two SG Indigo R4000 workstation linked via Ethernet and ATM . A series of performance measurements of video data streams over the IP network protocol using both the ATM and Ethernet networks have been taken . To carry out these experiments , a simplified version of the videophone that deals with the processing and communication elements was developed -LRB- i.e. we have removed the display element in the first stage -RRB- . This enabled us to study the performance issues and explain the behaviour of these video data streams over ATM and Ethernet . Two sets of experiments were initially designed . The first one used 100 frames and the second one used 500 frames . For each experiment , the time to transmit the specified number of frames was measured for each of the three video frame sizes : QCIF -LRB- 25KBytes -RRB- , CIF -LRB- 101KBytes -RRB- , and SCIF -LRB- 405KBytes -RRB- . These frame sizes have been adopted by the CCITT -LRB- part of recommendation H. 261 -RRB- . CIF stands for Common Intermediate Format -LRB- QCIF : Quarter CIF , SCIF Super CIF -RRB- . The results -LRB- averaged over 3 runs -RRB- are presented in the tables below . Frame Size Ethernet -LRB- seconds -RRB- ATM -LRB- seconds -RRB- QCIF 3.00 27.53 CIF 12.11 101.52 SCIF 47.91 502.31 Table 1 : Completion time for sending 100 frames Frame Size Ethernet -LRB- seconds -RRB- ATM -LRB- seconds -RRB- QCIF 16.67 136.97 CIF 59.41 575.49 SCIF 240.34 2628.25 Table 2 : Completion time for sending 500 frames The results depicted in these tables clearly indicate the performance improvement of Ethernet over ATM , and these results seemed consistent over the range of parameters tested . -LRB- i.e. frame size and number of frames -RRB- . To further investigate these unexpected results , the effect of dividing frames into packets -LRB- packetisation -RRB- before submitting them to the ATM network through the BSD socket interface is studied in the next Section . 3 Further Experiments For this analysis , the simplified version of the videophone was further developed to support the packetisation process , i.e dividing a frame into a number of packets -LRB- see figure below -RRB- . Simplified Video Application UDP TCP IP Ethernet ATM Original Frame Packet Packet Packet Packet Packet In this analysis , there are three important factors : the number of frames sent , the frame size -LRB- QCIF , CIF and SCIF -RRB- , and the packetisation process -LRB- packet size -RRB- . Three sets of experiments were designed to assess the sensitivity of these parameters . These three experiments were run such that for each frame size -LRB- QCIF , CIF and SCIF -RRB- , the packet size was varied . The results obtained seemed consistent for all the three video frame sizes tested , and the graphs exhibited the same pattern . Section 5 dicusses the results for CIF , similar reasoning can be applied to results for QCIF and SCIF frame sizes . 4 Processing Overheads This section identifies the major characteristics of the overheads involved in both ATM and Ethernet when executing the video application through TCP/IP and ATM protocol stacks . 4.1 Protocol Processing Overheads The number of memory accesses when data passes through a conventional protocol stack can have a significant overhead if packets are large . An application writes data into its buffer -LRB- called the application buffer -RRB- and then invokes a system call to send data . The socket layer copies the application buffer into a buffer in kernel space called the socket buffer . Then the transport layer -LRB- TCP -RRB- reads the data in the socket buffer to compute a checksum and finally the data is copied out to the network interface using DMA -LRB- for Ethernet -RRB- , and I/O programming for ATM -LSB- BCS93 -RSB- . Hence , the memory system is accessed five times for each word . Using the same reasoning , the memory system is also accessed five times for each word received -LSB- HS89 -RSB- . The data copy and checksum operation are memory intensive and their cost will scale with improvements in host memory bandwidth -LSB- GBN +89 -RSB- . In contrast , the protocol processing and operating system overheads will depend directly on the host 's CPU processing power . In -LSB- CJRS89 -RSB- , Clark et al , have shown that on a Sun 3/60 , 65 % of the cost to transmit maximum-length Ethernet packets is consumed by data movements in the memory system and 35 % on TCP/IP protocol processing and operating system overheads . 4.2 ATM AAL Processing Whereas the Ethernet network interface can handle up to 1500 byte packets , the ATM Adaptation Layer -LRB- AAL -RRB- has two major functions to further break IP packets into ATM cells . This operation has a significant impact since it is undertaken in the host interface . The AAL protocols generate the traffic that is carried in the ATM cells . This is achieved by performing a Convergence function , that is take whatever traffic is to be sent across the ATM network , establish the appropriate connections , then package the traffic received from the higher layers into the 48 byte information payload that is then passed down to the ATM layer for transmission . In the reverse direction , the AAL layer must receive the information payloads passed up by the from the ATM layer and put these into the form expected by the higher layer . The other major function of the AAL protocols is Segmentation And Reassembly -LRB- SAR -RRB- . SAR refers to the process by which a higher layer SDU -LRB- Service Data Unit -RRB- , passed to an AAL layer , is divided into units that can be carried in the 48 byte information payloads . For example , if a large data packet is passed to an AAL layer , the AAL will have to chop it into multiple 48 byte chunks before passing them to the ATM layer . At the destination , it will then need to reassemble small pieces back into an SDU before passing it to the higher layer . This means that that when the SDU is segmented , sufficient information is passed to allow the destination to reassemble the SDU back again . In the ATM fore computer interface cards , the MTU -LRB- maximum Transfer Unit -RRB- is 9188 bytes . 5 Evaluation Graphs 1 and 2 depict the results of the experiments for the QCIF video frame -LRB- 101K -RRB- . Graph 1 provides the completion time for 100 frames when varying the packet size from 128 bytes to 4 Kbytes . Graph 2 provides the completion time for 500 frames when varying the packet size from 128 bytes to 4 kbytes . The experiments were actually run for packet sizes ranging from 128 bytes to the full frame sizes . The graphs for QCIF , CIF and SCIF provided similar pattern , so Graphs 1 and 2 show only the window relevant to the evaluation . Appendix A contains the graphs of the results for the experiments with CIF and SCIF video frames . 5 10 15 20 25 30 500 1000 1500 2000 2500 3000 3500 4000 Completion Time -LRB- sec -RRB- Packet Size Graph 1 -LRB- QCIF -RRB- - Effect of packetisation on performance -LRB- 100 frames -RRB- Ethernet network ATM network 20 40 60 80 100 120 140 500 1000 1500 2000 2500 3000 3500 4000 Completion Time -LRB- sec -RRB- Packet Size Graph 2 -LRB- QCIF -RRB- - Effect of packetisation on performance -LRB- 500 frames -RRB- Ethernet network ATM network For the purpose of the evaluation of the results obtained , we classify the processing costs under two headings : ffl Protocol processing and operating system overheads ffl Data path movements . As advances in processor performance continue to outpace improvements in memory bandwidth and networks support longer packets , then proportionally less and less time is going to be spent on protocol processing and relating operating system overheads . The data path is the major component of communication costs -LRB- See Section 4 for number of memory accesses -RRB- . To discuss the communication costs of different network technologies , it is essential to discuss their data link rates , their maximum packet sizes , and thus the implication on the ratio of protocol processing versus the data movements involved in moving packets through the protocol stack . The data link rates for Ethernet , and ATM are respectively 10 Mbps , and 100 Mbps -LRB- TAXI 4B5B interface -RRB- . Their maximum packet size respectively is 1500 and 9188 bytes . At Ethernet rates , packet header processing is still a significant part of the total -LRB- up to 35 % -RRB- , but for ATM with their longer packets , it is dominated by the data path costs . Graphs 1 and 2 show that for small packet sizes , the throughput -LRB- completion time -RRB- with ATM networks is better than with Ethernet . For ATM , as packet size increases , the TCP/IP stack divides a packet into 9188 bytes , and hence spends a lot of time at this stage , prior to releasing the data to the ATM AAL -LRB- as explained in Section 4 -RRB- . The performance gets even worse due to the fact that the ATM AAL is performed by the host interface . The graphs show that it is not the latency or the protocol processing that is the major problem but rather the data movements . This is clearly indicated by its comparison to Ethernet . When sending smaller packets , these are passed through the data path and sent through a fast communication channel , whereas for longer packets , the delay resides in the memory system . Therefore , off-loading the protocol processing from the host , by making the network interface intelligent enough to perform protocol functions may not be sufficient to improve throughput . It is also important to improve the performance of the whole data path . One way to substantially increase application-to-application throughput is to eliminate some of the memory accesses in the data path . Also one of the major drawbacks is that front end processors tend to be slower than the host processor , thus increasing the latency -LSB- Kun92 -RSB- . In summary , the data movements in high speed network with large packets has a far greater impact then the execution of the protocol and operating system . One way to substantially increase application-to-application throughput is to eliminate some of the memory accesses in the data path . 6 Further Work The next phase of this work is to undertake performance measurements with the second generation of ATM interface cards , and assess the processing capabilities and their contribution towards reducing the application to application throughput . This will include comparison with the first generation interface cards and whether some of the issues that have been identified in this paper are addressed . This is our first set of results in experimenting with video streams , their synchronisation requirements and the impact of the host interface and the operating system . Current work is directed towards building a simple model to determine more accurately the behaviour of the -LRB- ATM versus Ethernet -RRB- data paths . 7 Acknowledgements The authors would like to thank Professor Mike Pilling , Pro Vice Chancellor of IT at Leeds for all his help and encouragement ; BISS Ltd. for introducing them to Synoptics ; KNet for the loan of a FORE system switch ; and Dr David Morris for his support with Silicon Graphics . References -LSB- BCS93 -RSB- E Biagioni , E Cooper , and R Sansom . Designing a practical atm lan . IEEE Network , March 1993 . -LSB- CJRS89 -RSB- D D Clark , V Jacobson , J Romkey , and H Salwen . Analysis of tcp processing overhead . IEEE Communications magazine , June 1989 . -LSB- GBN +89 -RSB- P Gunningberg , M Bjorkman , E Nordmark , S Pink , P Sjodin , and J Stromquist . Application protocols and performance benchmarks . IEEE Communications magazine , June 1989 . -LSB- HS89 -RSB- S Heatley and D Stokesberry . Analysis of transport measurements over a local area network . IEEE Communications magazine , June 1989 . -LSB- Kun92 -RSB- H T Kung . Gigabit local area networks : A system perspective . IEEE Communications Magazine , pages 79 -LCB- 89 , April 1992 . -LSB- LMT93 -RSB- I M Leslie , D R McAuley , and D L Tennenhouse . Atm everywhere ? IEEE Network , March 1993 . -LSB- New92 -RSB- P Newman . Atm technology for corporate networks . IEEE Communications Magazine , pages 90 -LCB- 101 , April 1992 . Appendix A Graphs for experiments with the CIF video frame 10 20 30 40 50 60 500 1000 1500 2000 2500 3000 3500 4000 Completion Time -LRB- sec -RRB- Packet Size Graph 3 -LRB- CIF -RRB- - Effect of packetisation on performance -LRB- 100 frames -RRB- Ethernet network ATM network 50 100 150 200 250 500 1000 1500 2000 2500 3000 3500 4000 Completion Time -LRB- sec -RRB- Packet Size Graph 4 -LRB- CIF -RRB- - Effect of packetisation on performance -LRB- 500 frames -RRB- Ethernet network ATM network Graphs for experiments with the SCIF video frame 20 40 60 80 100 500 1000 1500 2000 2500 3000 3500 4000 Completion Time -LRB- sec -RRB- Packet Size Graph 5 -LRB- SCIF -RRB- - Effect of packetisation on performance -LRB- 100 frames -RRB- Ethernet network ATM network 100 200 300 400 500 600 500 1000 1500 2000 2500 3000 3500 4000 Completion Time -LRB- sec -RRB- Packet Size Graph 6 -LRB- SCIF -RRB- - Effect of packetisation on performance -LRB- 500 frames -RRB- Ethernet network ATM network

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O 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 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 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 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 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 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 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 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 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


Implementations underlie the refinement of \ logical specifications '' and provide the foundations for program development , data type refinement , algorithm and data structure design . An implementation may invoke the need to provide some additional support , necessary for the representation of the abstract concepts of the source specification over the target . This can be modelled by an \ implementation triangle '' which requires the source to be interpreted into an extension of the target . That extension must not disturb the characteristic properties of the target . There has been much work on the composition of implementations in a way that reflects the structure of the source , but the problem of constructing primitive implementations has been left open . In this paper we present a methodto construct primitive implementations in a natural and direct manner . This method is related to an abstract concept called \ connections between specifications '' -LSB- see also \ Constructing Specification Morphisms '' by D.R. Smith in Symbolic Computation ,1993 -RSB- .

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

connection between specifications
equivalence of theories
logical specification
model expansion
software development
stepwise refinement
theory extension
theory presentation