32
Split-C for the New Millennium Andrew Begel, Phil Buonadonna, David Gay {abegel,philipb,dgay}@cs.berkeley.edu

Split-C for the New Millennium

Embed Size (px)

DESCRIPTION

Split-C for the New Millennium. Andrew Begel, Phil Buonadonna, David Gay {abegel,philipb,dgay}@cs.berkeley.edu. Introduction. Berkeley’s new Millennium cluster 16 2-way Intel 400 Mhz PII SMPs Myrinet NICs Virtual Interface Architecture (VIA) user-level network Active Messages Split-C - PowerPoint PPT Presentation

Citation preview

Page 1: Split-C for the New Millennium

Split-C for the New Millennium

Andrew Begel, Phil Buonadonna, David Gay

{abegel,philipb,dgay}@cs.berkeley.edu

Page 2: Split-C for the New Millennium

Introduction

• Berkeley’s new Millennium cluster– 16 2-way Intel 400 Mhz PII SMPs– Myrinet NICs

• Virtual Interface Architecture (VIA) user-level network• Active Messages• Split-C

Project GoalsImplement Active Messages over VIA

Implement and measure Split-C over VIA

Page 3: Split-C for the New Millennium

VI Architecture

VI Recv QSend Q

Descriptor

Descriptor

Descriptor Descriptor

Descriptor

Descriptor

Network Interface Controller

Status Status

Receive Doorbell

Send Doorbell

Virtual Address Space

RM RM RM

VI Consumer

Page 4: Split-C for the New Millennium

Active Messages

• Paradigm for message-based communication– Concept: Overlap communication/computation

• Implementation– Two-phase request/reply pairs– Endpoints: Processes Connection to a Virtual Network– Bundles: Collection of process endpoints

• Operations– AM_Map(), AM_Request(), AM_Reply(), AM_Poll()– Credit based flow-control scheme

Page 5: Split-C for the New Millennium

AM-VIA Components

• VI Queue (VIQ)– Logical channel for AM

message type– VI & independent

Send/Receive Queues– Independent request

credit scheme (counter n)

VI

Dxs(2*k)

Dxs(2*k +1)

Data(2*k)

Data(2*k +1)

Sen

d

Rec

v

n < k

Page 6: Split-C for the New Millennium

AM-VIA Components

• VI Queue (VIQ)– Logical channel for AM

message type– VI & independent

Send/Receive Queues– Independent request

credit scheme (counter n)

• MAP Object– Container for 3 VIQ’s

• Short,Medium,Long

MAP Object

Page 7: Split-C for the New Millennium

AM-VIA Components

• VI Queue (VIQ)– Logical channel for AM

message type– VI & independent

Send/Receive Queues– Independent request

credit scheme (counter n)

• MAP Object– Container for 3 VIQ’s

• Short,Medium,Long– Single Registered

Memory Region

MAP Object

Page 8: Split-C for the New Millennium

• Bundle: Pair of VI Completion Queues– Send/Receive

AM-VIA Integration

Proc A

Proc B

Proc C

• Endpoints: Collection of MAP objects– Virtual network emulated by point-to-point connections

Page 9: Split-C for the New Millennium

AM-VIA Operations

• Map – Allocates VI and registered memory resources and

establishes connections.

• Send operations– Copies data into a free send buffer posts descriptor.

• Receive operations– Short/Long messages: copies data and invokes handler– Medium: invokes handler w/ pointer to data buffer

• Polling– Request/Reply marshalling

• Empties completion queue into Request/Reply FIFO queues• Process single Request and/or Reply on each iteration

– Recycles send descriptors

Page 10: Split-C for the New Millennium

One-Way Message Timing

0

50

100

150

200

250

300

1 10 100 1000 10000

Message Size (bytes)

Tim

e (

us

ec

)

AM

VIA2

AMVIA

Page 11: Split-C for the New Millennium

Streaming Performance

0

50

100

150

200

250

300

350

400

450

1 10 100 1000 10000

Message Size (bytes)

Ba

nd

wid

th (

Mb

its

/se

c)

AM2

VIA2

AMVIA

Page 12: Split-C for the New Millennium

AMVIA LogP uBenchmarks

0.00

10.00

20.00

30.00

40.00

50.00

60.00

0 200 400 600 800 1000

Burst Size (Msgs)

Tim

e (

us

ec

)

Δ=0

Δ=5

Δ=10

Δ=15

Δ=20

Δ=25

Δ=30

Δ=35

Δ=40

Δ=45

Δ=50

`

Page 13: Split-C for the New Millennium

AM LogP uBenchmarks

0

5

10

15

20

25

0 200 400 600 800 1000

Burst Size (Msgs)

Tim

e (

us

ec

)

D=0

D=5

D=10

D=15

Page 14: Split-C for the New Millennium

Design Tradeoffs

• Logical Channels for Short/Medium/Long messages– Balances resources (VI’s, buffering) and reliability– Fine grained credit scheme – Requires advanced knowledge of reply size.– Requires request-reply marshalling upon receipt

• Data Copying– Simplest/Robust means to buffer management– Zero copy on medium receives requires k+1 buffering.

• Completion Queue/Bundle – Straightforward implementation of bundle– May overflow on high communication volume– Prevents endpoint migration

Page 15: Split-C for the New Millennium

Reflections

• AMVIA Implementation– Robust. Works for wide variety of AM applications– Performance suffers due to subtle architectural differences

• VI Architecture shortcomings– Lack of support for mapping a VI to a user context– VI Naming complicates IPC on the same host

• Active Message shortcomings– Memory Ownership semantics prevent true zero-copy for

medium messages

• Both benefit from some direct hardware support– VIA: Hardware doorbell management– AM: Distinction of request/reply messages

Page 16: Split-C for the New Millennium

Split-C

• C-based shared address space, parallel language• Distributed memory, explicit global pointers

• Split-phase global read/writes:

l := r r :- l

r := l

sync() store_sync()

process address Process 0

Process 1

1 0xdeadbeef

(__) (oo) /-------\/ / | ||* ||----|| ~~ ~~

Page 17: Split-C for the New Millennium

Implementing Split-C

• Split-C implemented as a modified gcc compiler• Split-phase reads, writes translated to library calls

Just need to implement a library

• Essential library calls:get char sync

put int + bulk store_sync

store ...

• Four implementations:– Split-C over AMVIA– Split-C over reliable VIA– Split-C over unreliable VIA– Split-C over shared memory + AMVIA

x

Page 18: Split-C for the New Millennium

Split-C over AMVIA

• Establish connection between every pair of processes

• Simple requests/replies to implement get, put, store, e.g.:p0: get(loc, <0x1, 0xbeef>)

request "get"(1, loc, 0xbeef) p1

p0 continues program execution

AM connection

Process 0

Process 2

Process 1

(__) (oo) /-------\/ / | ||* ||----|| ~~ ~~

Page 19: Split-C for the New Millennium

Split-C over AMVIA

• Establish connection between every pair of processes

• Simple requests/replies to implement get, put, store, e.g.:p0: get(loc, <0x1, 0xbeef>)

request "get"(1, loc, 0xbeef) p1

p0 continues program execution

p1: receive request "get"(…)

reply "getr"(loc, a-cow) p0

AM connection

Process 0

Process 2

Process 1

(__) (oo) /-------\/ / | ||* ||----|| ~~ ~~

(__) (oo) /-------\/ / | ||* ||----|| ~~ ~~

Page 20: Split-C for the New Millennium

Split-C over AMVIA

• Establish connection between every pair of processes

• Simple requests/replies to implement get, put, store, e.g.:p0: get(loc, <0x1, 0xbeef>)

request "get"(1, loc, 0xbeef) p1

p0 continues program execution

p1: receive request "get"(…)

reply "getr"(loc, a-cow) p0

p0: receive reply "getr"(…)

store cow at loc AM connection

Process 0

Process 2

Process 1

(__) (oo) /-------\/ / | ||* ||----|| ~~ ~~

(__) (oo) /-------\/ / | ||* ||----|| ~~ ~~

Page 21: Split-C for the New Millennium

Split-C over Reliable VIA

• Goal: Reduce send and receive overhead for Split-C operations

• Method 1: Specialise AMVIA for Split-C library– support only short, medium messages– remove all dynamic dispatch (AM calls, handler dispatch)– reduce message size

• Method 2: Allow reply-free requests (for stores)– reply to every nth store request, rather than every one– n = 1/4 of maximum credits

Page 22: Split-C for the New Millennium

Split-C over Unreliable VIA

• Replace request/reply mechanism of Split-C over reliable VIA

• Sliding-window + credit-based protocol• Acknowledge processed requests/replies

Þ reply-free requests handled automatically

• Timeouts detected in polling routine (unimplemented)

1 2 3

100

AckProcessRequest

RequestProcess

Ack

10010099

10

2 33

101

99

Stores

Page 23: Split-C for the New Millennium

Split-C over Shared Memory

• How can two processes on the same host communicate?– Loopback through network– Multi-Protocol VIA– Multi-Protocol AM– Shared Memory Split-C

• Each process maps the address space of every other process on the same host into its own.

• Heap is allocated with Sys V IPC Shared Memory.

• Data segment is mmapped via /proc file system.

• Stack is too dynamic to map.

Process 1 Local

Memory

Process 2 Local

Memory

P1’s view of

Process 2P2’s view

of Process 1

Address Spaces on Host mm4.millennium.berkeley.edu

P1’s address space P2’s address space

Page 24: Split-C for the New Millennium

Split-C Microbenchmarks

Short Two-Way Message Performance

0

20

40

60

80

100

120

Read Write Get Put Store

Tim

e (u

sec)

NOWAMVIAReliable VIAUnreliable VIASM AMVIA

Split-C Store Performance (Short and Bulk Messages)

(smaller numbers are better)

Medium Two-Way Store Performance

0.1

1

10

100

1000

1 10 100 1000 10000

Message Size (bytes)

Tim

e (u

sec)

NOW

AMVIA

Reliable VIA

Unreliable VIA

SM AMVIA

Page 25: Split-C for the New Millennium

Split-C Application Benchmarks3D FFT (Size = 128)

0

1

2

3

4

5

6

0 5 10 15 20

Processors

Rat

io t

o 1

pro

cess

or

AM

VIA

NOW

AMVIA

Reliable VIA

Unreliable VIA

Shared Memory

Conjugate Gradient

0

0.2

0.40.6

0.8

1

1.21.4

1.6

1.8

0 5 10 15 20

Processors

Rat

io t

o 1

pro

cess

or

AM

VIA

NOW

AMVIA

Reliable VIA

Unreliable VIA

Page 26: Split-C for the New Millennium

Reflections

• The specialization of the communications layer for Split-C reduced send and receive overhead.

• This overhead reduction appears to correlate with increased application performance and scaling.

• Sharing a process’s address space should be much easier than it is in Linux.

Page 27: Split-C for the New Millennium
Page 28: Split-C for the New Millennium

AM(v2) Architecture

• Components– Endpoints

request_hndlr_a()

request_hndlr_b()

reply_hndlr_a()

reply_hndlr_b()

...

...

Network

Page 29: Split-C for the New Millennium

AM(v2) Architecture

• Components– Endpoints– Virtual Networks

Proc A

Proc B

Proc C

Page 30: Split-C for the New Millennium

AM(v2) Architecture

• Components– Endpoints– Virtual Networks– Bundles

Proc A

Proc B

Proc C

Page 31: Split-C for the New Millennium

AM(v2) Architecture

• Components– Endpoints– Virtual Networks– Bundles

• Operations– Request / Reply

• Short, Med, Long– Create, Map, Free– Poll, Wait

• Credit based flow control

Proc A

Proc B

Proc C

Page 32: Split-C for the New Millennium

Active Messages

• Split-phase remote procedure calls– Concept: Overlap communication/computation

Request Handler

Reply Handler

Proc A Proc B

Request

Reply