contents pony the occam
play

Contents pony The occam- What is pony? Network Environment Why - PDF document

Contents pony The occam- What is pony? Network Environment Why do we need a unified concurrency model? Mario Schweigler and Adam Sampson Using pony Computing Laboratory, University of Kent Benchmarks Canterbury, UK


  1. Contents pony – The occam- π • What is pony? Network Environment • Why do we need a unified concurrency model? Mario Schweigler and Adam Sampson • Using pony Computing Laboratory, University of Kent • Benchmarks Canterbury, UK • Conclusions and future work CPA 2006: Mario Schweigler and Adam Sampson: pony 2 The Need for a Unified What is pony? Concurrency Model • Network environment for occam- π • It should be possible to distribute applications across several processors (or ‘back’ to a single (Name: anagram of [o]ccam, [p]i, [n]etwork, [y]) processor) without having to change the (Formerly known as ‘KRoC.net’) components • Comes with the KRoC distribution • This transparency should not damage the • Allows a unified approach for inter- and performance intra-processor concurrency – The underlying system should apply the overheads of networking only if needed in a concrete situation – this should be determined dynamically at runtime CPA 2006: Mario Schweigler and Adam Sampson: pony 3 CPA 2006: Mario Schweigler and Adam Sampson: pony 4 pony Applications Network-channel-types • A pony application consists of several nodes • The basic communication primitive between occam- π processes in pony are channel-types • There are master and slave nodes – each application has one master node and any • A network-channel-type (NCT) is the networked version of an occam- π channel-type number of slave nodes • Applications are administrated by an Application • It is transparent to the programmer whether a Name Server (ANS) which stores the network given channel-type is an intra-processor location of a master for a given application-name channel-type or an NCT and allows slave nodes to ‘look up’ the master CPA 2006: Mario Schweigler and Adam Sampson: pony 5 CPA 2006: Mario Schweigler and Adam Sampson: pony 6 1

  2. Network-channel-types Transparency in pony • Semantic transparency • NCTs have the same semantics and usage – All occam- π PROTOCOL s can be communicated over as normal channel-types NCTs – Bundle of channels – Semantics of communicated items are preserved, – Two ends, each of which may be shared including MOBILE semantics – Ends are mobile – Handling of NCTs is transparent to the programmer • NCT-ends may be shared , like any other channel-type-end • Ends may reside on different nodes, and • NCT-ends are mobile , like any other channel-type-end, and may be moved to other nodes can be communicated across distributed applications in the same way as between processes on the same node CPA 2006: Mario Schweigler and Adam Sampson: pony 7 CPA 2006: Mario Schweigler and Adam Sampson: pony 8 Transparency in pony Using pony • Pragmatic transparency • There are a number of public processes – pony infrastructure is set up dynamically for: when needed – Starting pony – If sender and receiver are on the same node, – Explicit allocation of NCT-ends communication only involves ‘traditional’ – Shutting down pony channel-word access – If they are on different nodes, communication – Error-handling goes through the pony infrastructure (and the – Message-handling network) CPA 2006: Mario Schweigler and Adam Sampson: pony 9 CPA 2006: Mario Schweigler and Adam Sampson: pony 10 Starting pony Starting pony • Startup process contacts the ANS • Startup process • If our node is the master, its location is stored by – Starts the pony environment on a node the ANS • Returns: • If our node is a slave – A network-handle – Startup process gets location of master from ANS • Used for allocation and shutdown – Connects to master – An error-handle if required • On success, startup process starts the pony • Used for error-handling environment and returns the requested handles – A message-handle if required • Otherwise returns error • Used for message-handling CPA 2006: Mario Schweigler and Adam Sampson: pony 11 CPA 2006: Mario Schweigler and Adam Sampson: pony 12 2

  3. Explicit Allocation of NCT-ends Explicit Allocation of NCT-ends • pony’s allocation process returns an end of an • If parameters are valid, allocation process NCT allocates and returns the NCT-end – The ends of an NCT may be allocated on different • Allocation process returns error if there is a nodes at any given time mismatch with previously allocated ends • Allocation process communicates with pony of the same name, regarding: environment via network-handle (given as a parameter) – Type of the channel-type • An explicitly allocated NCT is identified by a – Shared/unshared properties of its ends unique NCT-name stored by the master node CPA 2006: Mario Schweigler and Adam Sampson: pony 13 CPA 2006: Mario Schweigler and Adam Sampson: pony 14 Implicit Allocation by Moving Shutting down pony • Any channel-type-end, including NCT-ends, may • Shutdown process communicates with pony be moved along a channel environment via network-handle (given as a parameter) • If an end of a locally declared channel-type is moved to another node (along a channel of an • Must be called after all activity on (possibly) NCT) for the first time, this channel-type is networked channel-types has ceased implicitly allocated by the pony environment • If node is master, it notifies the ANS about the – That channel-type automatically becomes an NCT shutdown – Programmer does not need to take any action himself • pony environment shuts down its internal – Does not even need to be aware whether the end is components sent to a process on the same or on a remote node CPA 2006: Mario Schweigler and Adam Sampson: pony 15 CPA 2006: Mario Schweigler and Adam Sampson: pony 16 Error-handling and Configuration Message-handling • Error-handling used for the detection of • Done via simple configuration files networking errors during the operation of • Used to configure pony applications – Network location of a node • Message-handling used for outputting – Network location of the ANS status and error messages • All settings may be omitted • Not discussed in the paper; see Mario’s – In this case either defaults are used or the PhD thesis for details correct setting is detected automatically CPA 2006: Mario Schweigler and Adam Sampson: pony 17 CPA 2006: Mario Schweigler and Adam Sampson: pony 18 3

  4. ‘ commstime ’ Example Implementation of pony • The classical ‘ commstime ’ benchmark • Brief overview of pony’s internal components can be found in the paper • For a detailed discussion, see Mario’s thesis CPA 2006: Mario Schweigler and Adam Sampson: pony 19 CPA 2006: Mario Schweigler and Adam Sampson: pony 20 Non-distributed ‘ commstime ’ Distributed ‘ commstime ’ PROC commstime (CHAN BYTE key?, scr!, err!) BOOL use.seq.delta: • Each sub-process runs on a separate node INT num.loops: SEQ ... Find out whether to use the sequential or the parallel delta • Channels between the processes become ... Find out the number of loops -- Channels between the processes NCTs containing a single INT channel CHAN INT a, b, c, d: -- Run sub-processes in parallel PAR • Used for benchmarking pony (see below) prefix (0, b?, a!) IF use.seq.delta -- Sequential delta seq.delta (a?, c!, d!) TRUE -- Parallel delta delta (a?, c!, d!) succ (c?, b!) -- Monitoring process consume (num.loops, d?, scr!) : CPA 2006: Mario Schweigler and Adam Sampson: pony 21 CPA 2006: Mario Schweigler and Adam Sampson: pony 22 Distributed ‘ commstime ’ – Distributed ‘ commstime ’ – The ‘ prefix ’ Node (1) The Channel-type Declaration PROC commstime.prefix (CHAN BYTE key?, scr!, err!) -- Network-handle -- Channel-type with one INT channel PONY.NETHANDLE! net.handle: CHAN TYPE INT.CT -- NCT-end variables MOBILE RECORD INT.CT? b.svr: CHAN INT chan?: INT.CT! a.cli: : -- Other variables INT own.node.id, result: SEQ -- Start pony pony.startup.unh (PONYC.NETTYPE.TCPIP, "", "commstime", "", PONYC.NODETYPE.SLAVE, own.node.id, net.handle, result) ASSERT (result = PONYC.RESULT.STARTUP.OK) CPA 2006: Mario Schweigler and Adam Sampson: pony 23 CPA 2006: Mario Schweigler and Adam Sampson: pony 24 4

Recommend


More recommend