20-Oct-15 Copyright P.H.Welch1 A Process-Oriented Architecture for Complex System Modelling Peter...
-
Upload
silvester-maxwell -
Category
Documents
-
view
219 -
download
0
Transcript of 20-Oct-15 Copyright P.H.Welch1 A Process-Oriented Architecture for Complex System Modelling Peter...
Apr 21, 2023 Copyright P.H.Welch 1
A Process-Oriented A Process-Oriented Architecture for Complex Architecture for Complex
System ModellingSystem Modelling
A Process-Oriented A Process-Oriented Architecture for Complex Architecture for Complex
System ModellingSystem Modelling
Peter Welch and Carl Ritson
Computing Laboratory, University of Kent at Canterbury
Napier University (17Napier University (17th.th. December, 2008) December, 2008)[Based on paper at CPA 2007 (July, 2007)][Based on paper at CPA 2007 (July, 2007)]
Apr 21, 2023 Copyright P.H.Welch 2
Fine-grainedFine-grained Massively parallelMassively parallel Process-orientedProcess-oriented
Architectural Basics (Complex Modellling)Architectural Basics (Complex Modellling)Architectural Basics (Complex Modellling)Architectural Basics (Complex Modellling)
This is the way This is the way of the world ...of the world ...
Processes, networks, networks-within-Processes, networks, networks-within-networksnetworks Channel (reader-writer) synchronisation Barrier (multiway synchronisation)
CSP / CSP / occam-occam-ππ
ππ-calc / -calc / occam-occam-ππ
Ever-changing network topologiesEver-changing network topologies Dynamic birth, re-connections, death Mobile channels and processes Mobile process location and neighbour awareness
Apr 21, 2023 Copyright P.H.Welch 3
Haemostasis: Haemostasis: we consider a greatly simplified model of the we consider a greatly simplified model of the formation of blood clots in response to damage in blood formation of blood clots in response to damage in blood vessels.vessels.
Case Study: Case Study: blood clottingblood clottingCase Study: Case Study: blood clottingblood clotting
When activated, they become stickysticky …
PlateletsPlatelets are passive quasi-cells carried in the bloodstream. They become activatedactivated when a balance between chemical suppressants and activators shift in favour of activation.
We are just going to model the clumping together of such sticky activated platelets to form clotsclots.
To learn and refine our modelling techniques ...
Apr 21, 2023 Copyright P.H.Welch 4
Programmed behaviourProgrammed behaviour Blood platelets (smooth / sticky) Blood vessel (walls) Wounding (punching a hole in the blood vessel) Chemical factors (to stimulate / inhibit platelets) Clotting rules (platelets move together, clots merge)
Emergent behaviourEmergent behaviour Blood loss Clot formation Plugging the wound Stemming the loss of blood
Case Study: Case Study: blood clottingblood clottingCase Study: Case Study: blood clottingblood clotting
Apr 21, 2023 Copyright P.H.Welch 5
Model sizeModel size Tens of millions of processes (mostly space sites) Hundreds of thousands of platelets (~ 2%)
Model safetyModel safety No race hazards No deadlocks No livelocks No process starvation
Case Study: Case Study: blood clottingblood clottingCase Study: Case Study: blood clottingblood clotting
byby occam-occam-ππ
Model scalingModel scaling ~ 2M processes per processor PC cluster (24 processors, with reasonable speedup)
only spent 1 only spent 1 week, so farweek, so far
byby designdesign
Apr 21, 2023 Copyright P.H.Welch 6
Show video …Show video …
Apr 21, 2023 Copyright P.H.Welch 7
CarefulCareful Writer blocks if reader is not ready Lots of deadlock possibilities
Synchronised CommunicationSynchronised CommunicationSynchronised CommunicationSynchronised Communicationc
BBAA
BenefitBenefit Once the writer has written, it knowsknows the reader has read
OK: plenty of other processes to OK: plenty of other processes to run and ultra-fast context switch run and ultra-fast context switch (comparable to a procedure call)(comparable to a procedure call)
OK: work with (a small set of) OK: work with (a small set of) synchronisation patterns for which synchronisation patterns for which we have proven safety theoremswe have proven safety theorems
Apr 21, 2023 Copyright P.H.Welch 8
Simple Deadlock ExampleSimple Deadlock ExampleSimple Deadlock ExampleSimple Deadlock Example
c
d
If there is no discipline on when AA and BB communicate, then AA may commit to output on cc, followed by BB on dd … or vice-versa. Either way, neither are listening and both are stuck. Same happens if both commit to input.
AA BB
Apr 21, 2023 Copyright P.H.Welch 9
request
Client - Server PatternClient - Server PatternClient - Server PatternClient - Server Pattern
replyclientclient serverserver
clientclient : makes a requestrequest any time, then commits to taking replyreply.
serverserver : always accepts a requestrequest (within some bounded time), then always makes a replyreply (within some bounded time). It may make requests itself, as a clientclient to other serversservers.
No deadlock is now possible from No deadlock is now possible from
this client-server relationship.this client-server relationship.
Apr 21, 2023 Copyright P.H.Welch 10
Client - Server PatternClient - Server PatternClient - Server PatternClient - Server Pattern
clientclient : makes a requestrequest any time, then commits to taking replyreply.
clientclient serverserver
serverserver : always accepts a requestrequest (within some bounded time), then always makes a replyreply (within some bounded time). It may make requests itself, as a clientclient to other serversservers.
Symbology:Symbology: this represents this representsa client-server relation. It points a client-server relation. It points toto the the
server and allows a server and allows a 2-way2-way conversation conversation(initiated by the client)(initiated by the client)
Apr 21, 2023 Copyright P.H.Welch 11
Client - Server PatternClient - Server PatternClient - Server PatternClient - Server PatternA serverserver may have many clientsclients …
Only one clientclient at a time converses with the serverserver . They form an orderly queue. Still no deadlock possible – and no clientclient starvation. No polling on the queue, so no livelock either.
Apr 21, 2023 Copyright P.H.Welch 12
Client - Server TheoremClient - Server TheoremClient - Server TheoremClient - Server TheoremA client-serverclient-server system that has no cycles in its client-serverclient-server
relations is deadlock, livelock and starvation free.
Apr 21, 2023 Copyright P.H.Welch 13
BarriersBarriersBarriersBarriers
Basic CSPCSP semantics apply. When a process synchronisessynchronises on a barrier, it blocks until all other processes enrolledenrolled on the barrier have also synchronisedsynchronised. Once the barrier has completed (i.e. all enrolledenrolled processes have synchronisedsynchronised), all blocked processes are rescheduled for execution.
The occam-occam- BARRIERBARRIER type corresponds to a multiway CSPCSP eventevent, though some higher level design patterns (such as resignationresignation) have been built in.
bb
worker (0) worker (1) worker (n-1)∙∙∙
Apr 21, 2023 Copyright P.H.Welch 14
The occam-occam- BARRIERBARRIER type corresponds to a multiway CSPCSP eventevent, though some higher level design patterns (such as resignationresignation) have been built in.
bb
worker (0) worker (1) worker (n-1)∙∙∙
BARRIERBARRIER b b::PARPAR i = 0 FOR n i = 0 FOR n ENROLLENROLL b b worker (i, worker (i, bb))
The number of processes enrolled on an in-scope barrier is unchanged by a
non-enrolling PARPAR – only one of its components may reference it.
The number of processes enrolled on an in-scope barrier is unchanged by a
non-enrolling PARPAR – only one of its components may reference it.
A PARPAR construct must explicitly ENROLLENROLL its
components on barriers
BarriersBarriersBarriersBarriers
Apr 21, 2023 Copyright P.H.Welch 15
cc
bb
BARRIERBARRIER b b,, cc::PARPAR i = 0 FOR n i = 0 FOR n ENROLLENROLL b b, , cc worker (i, worker (i, bb, , cc))
worker (0) worker (1) worker (n-1)∙∙∙
To synchronise on a barrier:
SYNCSYNC b b
Processes may synchronise on more than one barrier:
SYNCSYNC ccor
BarriersBarriersBarriersBarriers
Apr 21, 2023 Copyright P.H.Welch 16
Barriers are commonly used to synchronise multiple phasesphases of computation between a set of parallel processes. Within each phase, other synchronisations (channel / barrier) may take place:
PROC worker (VAL INT id, PROC worker (VAL INT id, BARRIER bBARRIER b, , cc)) ... local declarations / initialisation... local declarations / initialisation WHILE runningWHILE running SEQSEQ SYNC bSYNC b ... phase b computation... phase b computation SYNC cSYNC c ... phase c computation... phase c computation::
Phased Parallel ComputationPhased Parallel ComputationPhased Parallel ComputationPhased Parallel Computation
Apr 21, 2023 Copyright P.H.Welch 17
occam-occam- BARRIERBARRIER synchronisationsynchronisation is safesafe in the sense that enrollmentenrollment and resignationresignation are automatically managed. A process may synchronisesynchronise on a BARRIERBARRIER if and only if it is enrolledenrolled.
Try to break this rule … your program won’t compile. There are zero memory and run-time costs to enforce it. Try to break this rule … your program won’t compile. There are zero memory and run-time costs to enforce it.
Barrier SynchronisationBarrier SynchronisationBarrier SynchronisationBarrier Synchronisation
Apr 21, 2023 Copyright P.H.Welch 18
MultiClient-Server PatternMultiClient-Server PatternMultiClient-Server PatternMultiClient-Server PatternSometimes, a serverserver cannot reply to a clientclient until it has been given information from allall its clientsclients. . [This is like a [This is like a barrier synchronisation, but with a message exchange.]barrier synchronisation, but with a message exchange.]
If we know the server and all its clients are in that state, it is safe to proceed …
Apr 21, 2023 Copyright P.H.Welch 19
MultiClient-Server Pattern 1MultiClient-Server Pattern 1MultiClient-Server Pattern 1MultiClient-Server Pattern 1If the serverserver knows how many clientsclients (say nn) will be calling …
… each clientclient calls the serverserver twice: first on a channel to give its information and, then, on a different channel to request the serverserver ’s answer. The serverserver takes nn pieces of information on its first service channel, then delivers its answer nn times down the other. [Note: each transaction still conforms to the basic client-[Note: each transaction still conforms to the basic client-server pattern.]server pattern.]
Apr 21, 2023 Copyright P.H.Welch 20
If the serverserver does not know how many clientsclients will be calling …
… each clientclient calls the serverserver twice: first to give its information and, then, to request the serverserver ’s answer. In between,In between, they barrier synchronise with each other. The serverserver first consumes information on its service channel; when an answer request arrives, it knows all the clients have reported, computes its answer and delivers it as many times as asked. [Note: each [Note: each transaction still conforms to the basic client-server pattern.]transaction still conforms to the basic client-server pattern.]
MultiClient-Server Pattern 2MultiClient-Server Pattern 2MultiClient-Server Pattern 2MultiClient-Server Pattern 2
Apr 21, 2023 Copyright P.H.Welch 21
An Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceWe propose a We propose a layeredlayered dynamicdynamic client-serverclient-server phased-barrierphased-barrier architecture.architecture.
Bottom LayerBottom LayerBottom LayerBottom Layer
‘‘Site’ processes:Site’ processes: pure servers representing a locality. They pure servers representing a locality. They hold state information defining world topology hold state information defining world topology (by holding (by holding client-ends of the service channels of neighbouring sites)client-ends of the service channels of neighbouring sites) and local environmental data and local environmental data (such as the presence of (such as the presence of mobile agents, chemical factors, permeability, flow vectors)mobile agents, chemical factors, permeability, flow vectors)..
The topology is usually a Euclidean grid and fixed, though The topology is usually a Euclidean grid and fixed, though this is not essential.this is not essential.
Apr 21, 2023 Copyright P.H.Welch 22
An Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceWe propose a We propose a layeredlayered dynamicdynamic client-serverclient-server phased-barrierphased-barrier architecture.architecture.
Bottom LayerBottom LayerBottom LayerBottom Layer
They do not use their neighbour client connections. They They do not use their neighbour client connections. They only pass them on to visiting agents who wish to move.only pass them on to visiting agents who wish to move.
‘‘Site’ processes:Site’ processes: pure servers representing a locality. They pure servers representing a locality. They hold state information defining world topology hold state information defining world topology (by holding (by holding client-ends of the service channels of neighbouring sites)client-ends of the service channels of neighbouring sites) and local environmental data and local environmental data (such as the presence of (such as the presence of mobile agents, chemical factors, permeability, flow vectors)mobile agents, chemical factors, permeability, flow vectors)..
Apr 21, 2023 Copyright P.H.Welch 23
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
The The MatrixMatrixThe The
MatrixMatrix
Apr 21, 2023 Copyright P.H.Welch 24
An Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceWe propose a We propose a layeredlayered dynamicdynamic client-serverclient-server phased-barrierphased-barrier architecture.architecture.
Second LayerSecond LayerSecond LayerSecond Layer
They keep in step through barrier synchronisation, following They keep in step through barrier synchronisation, following a simple cycle …a simple cycle …
Mobile ‘agent’ processes:Mobile ‘agent’ processes: pure clients (of site servers and pure clients (of site servers and higher-lever controllers). They are attached to sites through higher-lever controllers). They are attached to sites through which they observe the world and change it. They move which they observe the world and change it. They move from site to site under their own (and their contoller’s) rules. from site to site under their own (and their contoller’s) rules.
Apr 21, 2023 Copyright P.H.Welch 25
An Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceWe propose a We propose a layeredlayered dynamicdynamic client-serverclient-server phased-barrierphased-barrier architecture.architecture.
Second LayerSecond LayerSecond LayerSecond Layer
WHILE aliveWHILE alive SEQ SEQ SYNC discoverySYNC discovery ... observe local neighbourhood... observe local neighbourhood SYNC modifySYNC modify ... change local neighbourhood... change local neighbourhood
Mobile ‘agent’ processes:Mobile ‘agent’ processes: pure clients (of site servers and pure clients (of site servers and higher-lever controllers).higher-lever controllers).
all seeall seea consistent a consistent
viewview
and, possibly, and, possibly, movemove
Apr 21, 2023 Copyright P.H.Welch 26
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
The The MatrixMatrixThe The
MatrixMatrix
Mobile Mobile AgentsAgentsMobile Mobile AgentsAgents
Apr 21, 2023 Copyright P.H.Welch 27
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
Apr 21, 2023 Copyright P.H.Welch 28
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
Apr 21, 2023 Copyright P.H.Welch 29
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
Apr 21, 2023 Copyright P.H.Welch 30
An Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceWe propose a We propose a layeredlayered dynamicdynamic client-serverclient-server phased-barrierphased-barrier architecture.architecture.
Third LayerThird LayerThird LayerThird Layer
‘‘Coordinator’ processes:Coordinator’ processes: server processes managing rules server processes managing rules for group behaviour amongst agents. They may make client for group behaviour amongst agents. They may make client transactions with even higher-level controllers …transactions with even higher-level controllers …
Higher LayersHigher LayersHigher LayersHigher Layers
‘‘Super-coordinator’ processes:Super-coordinator’ processes: server processes managing server processes managing rules for group behaviour amongst coordinators. rules for group behaviour amongst coordinators. Etc …Etc …
Apr 21, 2023 Copyright P.H.Welch 31
An Architecture for EmergenceAn Architecture for EmergenceAn Architecture for EmergenceAn Architecture for Emergence
Apr 21, 2023 Copyright P.H.Welch 32
Blood Clotting ModelBlood Clotting ModelBlood Clotting ModelBlood Clotting Model
Pure servers. Define a 3D Euclidean grid. Each site has 26 Pure servers. Define a 3D Euclidean grid. Each site has 26 neighbours. They allow neighbours. They allow oneone platelet at a time – platelet at a time – any numberany number of chemical factors.of chemical factors.
Stores blood vessel Stores blood vessel wall flagwall flag (no agents may enter if set), a (no agents may enter if set), a voxelvoxel (from a 3D array spanning all sites, (from a 3D array spanning all sites, colouredcoloured if platelet if platelet is present), is present), blood flow vectorblood flow vector..
If a platelet is present, it holds the client-end of the platelet’s If a platelet is present, it holds the client-end of the platelet’s clotting controller processclotting controller process (two layers up). It may give this (two layers up). It may give this to an enquiry from a platelet on a neigbouring site.to an enquiry from a platelet on a neigbouring site.
Site Processes (bottom layer)Site Processes (bottom layer)Site Processes (bottom layer)Site Processes (bottom layer)
Apr 21, 2023 Copyright P.H.Welch 33
Blood Clotting ModelBlood Clotting ModelBlood Clotting ModelBlood Clotting ModelPlatelet Processes (second layer)Platelet Processes (second layer)Platelet Processes (second layer)Platelet Processes (second layer)
Pure clients. Drive the whole model. Engage on Pure clients. Drive the whole model. Engage on discoverydiscovery and and modifymodify barriers. Communicate with and move between barriers. Communicate with and move between site servers. site servers. FORKFORK off and communicate with their clotting off and communicate with their clotting controllers. controllers. SmoothSmooth or or stickysticky (initially (initially smoothsmooth).).
Pure clients. Engage on Pure clients. Engage on discoverydiscovery and and modifymodify barriers. barriers. Communicate with and move between site servers.Communicate with and move between site servers.
Chemical Factor Processes (second layer)Chemical Factor Processes (second layer)Chemical Factor Processes (second layer)Chemical Factor Processes (second layer)
Initial vector away from wound. Modifies factor level and Initial vector away from wound. Modifies factor level and flow vector in sites. Eventually drawn into blood flow.flow vector in sites. Eventually drawn into blood flow.
Apr 21, 2023 Copyright P.H.Welch 34
Blood Clotting ModelBlood Clotting ModelBlood Clotting ModelBlood Clotting Model
Controlling servers for groups of stuck-together platelets.Controlling servers for groups of stuck-together platelets.
Accumulate flow vectors from platelets and information on Accumulate flow vectors from platelets and information on adjacent sites (e.g. bumped into another clot?).adjacent sites (e.g. bumped into another clot?).
If sufficiently hard bump (possibly into more than one clot), If sufficiently hard bump (possibly into more than one clot), engages in election with bumped clots to see who takes engages in election with bumped clots to see who takes over all the platelets in a merged clot. Terminates if loses.over all the platelets in a merged clot. Terminates if loses.
Clot Processes (third layer)Clot Processes (third layer)Clot Processes (third layer)Clot Processes (third layer)
Otherwise, informs combined set of platelets of their new Otherwise, informs combined set of platelets of their new controller.controller.
multiclient-server pattern 1multiclient-server pattern 1
Apr 21, 2023 Copyright P.H.Welch 35
Blood Clotting ModelBlood Clotting ModelBlood Clotting ModelBlood Clotting Model
Controlling servers for groups of stuck-together platelets.Controlling servers for groups of stuck-together platelets.
Accumulate flow vectors from platelets and information on Accumulate flow vectors from platelets and information on adjacent sites (e.g. bumped into another clot?).adjacent sites (e.g. bumped into another clot?).
Then, makes decision about which way (if any) to move. Then, makes decision about which way (if any) to move. Informs all its platelets.Informs all its platelets.
Clot Processes (third layer)Clot Processes (third layer)Clot Processes (third layer)Clot Processes (third layer)
multiclient-server pattern 1multiclient-server pattern 1
Apr 21, 2023 Copyright P.H.Welch 36
Blood Clotting ModelBlood Clotting ModelBlood Clotting ModelBlood Clotting ModelPlatelet Processes (second layer) – again ...Platelet Processes (second layer) – again ...Platelet Processes (second layer) – again ...Platelet Processes (second layer) – again ...
Discovery phase.Discovery phase. Get chemical factors, flow vector and clot Get chemical factors, flow vector and clot information in the neighbourhood from site. If smooth and information in the neighbourhood from site. If smooth and enough factor, fork off clot controller and become sticky. If enough factor, fork off clot controller and become sticky. If sticky, forward flow vector and neighbourhood info to clot for sticky, forward flow vector and neighbourhood info to clot for movement decision – else make it ourself. Receive info movement decision – else make it ourself. Receive info from clot on possible new clot controller and movement from clot on possible new clot controller and movement decision. decision. If moving, offer move to target site.If moving, offer move to target site.
Modify phase.Modify phase. If not moving, this is null. If not moving, this is null. If trying to move, If trying to move, get decision from target siteget decision from target site – other clots may have tried to – other clots may have tried to move there. If OK, move.move there. If OK, move.
multiclient-server pattern 2multiclient-server pattern 2
Apr 21, 2023 Copyright P.H.Welch 37
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 38
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 39
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 40
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 41
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 42
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 43
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 44
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 45
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 46
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 47
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 48
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 49
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 50
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 51
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 52
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 53
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 54
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 55
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 56
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 57
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 58
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 59
3-D Bloodstream3-D Bloodstream3-D Bloodstream3-D Bloodstream
Apr 21, 2023 Copyright P.H.Welch 60
Results so far …Results so far …Results so far …Results so far …The biological accuracy of the current model is very The biological accuracy of the current model is very approximate. Nevertheless …approximate. Nevertheless …
Emergent BehaviourEmergent BehaviourEmergent BehaviourEmergent Behaviour
Clots do form is apparently realistic ways. They gather Clots do form is apparently realistic ways. They gather round the wound, form a plug and staunch the loss of blood round the wound, form a plug and staunch the loss of blood (deduced from the flow of platelets – we are not directly (deduced from the flow of platelets – we are not directly modeling blood).modeling blood).
Simple experiments are possible – for example, varying the Simple experiments are possible – for example, varying the concentration of platelets. Too high and the clots form too concentration of platelets. Too high and the clots form too fast around the leading edge of the wound, block platelet fast around the leading edge of the wound, block platelet traffic and fail to seal the hole. Too low and the clots form traffic and fail to seal the hole. Too low and the clots form too slow and get swept away. Nature demands a balance!too slow and get swept away. Nature demands a balance!
Apr 21, 2023 Copyright P.H.Welch 61
Results so far …Results so far …Results so far …Results so far …The biological accuracy of the current model is very The biological accuracy of the current model is very approximate. Nevertheless …approximate. Nevertheless …
Emergent BehaviourEmergent BehaviourEmergent BehaviourEmergent Behaviour
The accuracy can be refined in a stable way to greater and The accuracy can be refined in a stable way to greater and greater realism. greater realism.
More agent types can be added – More agent types can be added – clot bustingclot busting factors, factors, proteins (like proteins (like fibrinfibrin that make up the bulk of real clots). that make up the bulk of real clots).
Existing agent types can be refined. Introduce a time lag Existing agent types can be refined. Introduce a time lag delaying the onset of a sufficiently stimulated platelet (so it delaying the onset of a sufficiently stimulated platelet (so it can get a little way past initial encounters with existing clots).can get a little way past initial encounters with existing clots).
Apr 21, 2023 Copyright P.H.Welch 62
Results so far …Results so far …Results so far …Results so far …
PerformancePerformancePerformancePerformance
Models run at reasonable speed with up to ~3M processes Models run at reasonable speed with up to ~3M processes on commodity PCs (3.0 GHz, 1Gbyte RAM). Memory is on commodity PCs (3.0 GHz, 1Gbyte RAM). Memory is main limitation – the above uses most of it! Platelet main limitation – the above uses most of it! Platelet densities up to 2% (a reasonable limit for healthy humans) densities up to 2% (a reasonable limit for healthy humans) imply around 60K agents – actual numbers will be changing imply around 60K agents – actual numbers will be changing continuously. Achieves around 8 simulation cycles per sec.continuously. Achieves around 8 simulation cycles per sec.
Apr 21, 2023 Copyright P.H.Welch 63
Apr 21, 2023 Copyright P.H.Welch 64
Apr 21, 2023 Copyright P.H.Welch 65
Apr 21, 2023 Copyright P.H.Welch 66
Apr 21, 2023 Copyright P.H.Welch 67
Apr 21, 2023 Copyright P.H.Welch 68
Apr 21, 2023 Copyright P.H.Welch 69
Apr 21, 2023 Copyright P.H.Welch 70
Apr 21, 2023 Copyright P.H.Welch 71
Conclusions and Future WorkConclusions and Future WorkConclusions and Future WorkConclusions and Future Work
The The fine-grained massively-parallel process-orientedfine-grained massively-parallel process-oriented architecture proposed has proven remarkably architecture proposed has proven remarkably flexible flexible ......
It efficiently supports the necessary dynamics. It efficiently supports the necessary dynamics. AgentsAgents move without any complex data structures and algorithms move without any complex data structures and algorithms to manage locality – they find each other simply by to manage locality – they find each other simply by seeingseeing (or (or bumping intobumping into) each other in their neighbourhood. Local ) each other in their neighbourhood. Local environmental factors and topology are maintained by the environmental factors and topology are maintained by the bottom level bottom level sitesite servers. Group dynamics of servers. Group dynamics of compound compound agentsagents are managed by higher level servers. are managed by higher level servers.
It efficiently supports the necessary dynamics. It efficiently supports the necessary dynamics. AgentsAgents move without any complex data structures and algorithms move without any complex data structures and algorithms to manage locality – they find each other simply by to manage locality – they find each other simply by seeingseeing (or (or bumping intobumping into) each other in their neighbourhood. Local ) each other in their neighbourhood. Local environmental factors and topology are maintained by the environmental factors and topology are maintained by the bottom level bottom level sitesite servers. Group dynamics of servers. Group dynamics of compound compound agentsagents are managed by higher level servers. are managed by higher level servers.
Apr 21, 2023 Copyright P.H.Welch 72
Conclusions and Future WorkConclusions and Future WorkConclusions and Future WorkConclusions and Future Work
The The fine-grained massively-parallel process-orientedfine-grained massively-parallel process-oriented architecture proposed has proven remarkably flexible, architecture proposed has proven remarkably flexible, stablestable ... ...
The The cost of changecost of change in the system is proportional to the in the system is proportional to the size size of the changeof the change – not to the – not to the size of the systemsize of the system..The The cost of changecost of change in the system is proportional to the in the system is proportional to the size size of the changeof the change – not to the – not to the size of the systemsize of the system..
This enables us to This enables us to scale up the complexityscale up the complexity of the models of the models with with no obvious limitsno obvious limits..This enables us to This enables us to scale up the complexityscale up the complexity of the models of the models with with no obvious limitsno obvious limits..
Apr 21, 2023 Copyright P.H.Welch 73
Conclusions and Future WorkConclusions and Future WorkConclusions and Future WorkConclusions and Future Work
The The fine-grained massively-parallel process-orientedfine-grained massively-parallel process-oriented architecture proposed has proven remarkably flexible, stable architecture proposed has proven remarkably flexible, stable and and safe safe ......
It is free from It is free from race hazardsrace hazards, , deadlockdeadlock, , livelocklivelock and and process process starvationstarvation by designby design..It is free from It is free from race hazardsrace hazards, , deadlockdeadlock, , livelocklivelock and and process process starvationstarvation by designby design..
This comes from language design (This comes from language design (occam-occam-ππ) and a small ) and a small set of synchronisation patterns for which we have set of synchronisation patterns for which we have provenproven safety theorems.safety theorems.
This comes from language design (This comes from language design (occam-occam-ππ) and a small ) and a small set of synchronisation patterns for which we have set of synchronisation patterns for which we have provenproven safety theorems.safety theorems.
Apr 21, 2023 Copyright P.H.Welch 74
Conclusions and Future WorkConclusions and Future WorkConclusions and Future WorkConclusions and Future Work
The The fine-grained massively-parallel process-orientedfine-grained massively-parallel process-oriented architecture proposed has proven remarkably flexible, stable architecture proposed has proven remarkably flexible, stable and and safesafe. So far, it has . So far, it has scaledscaled (reasonably) on a PC-cluster. (reasonably) on a PC-cluster.
This was a 24 node cluster of This was a 24 node cluster of 3.0 GHz, 1Gbyte RAM with 3.0 GHz, 1Gbyte RAM with fast Ethernet and switchfast Ethernet and switch..This was a 24 node cluster of This was a 24 node cluster of 3.0 GHz, 1Gbyte RAM with 3.0 GHz, 1Gbyte RAM with fast Ethernet and switchfast Ethernet and switch..
But we have But we have (Carl has)(Carl has) only spent one week on this ... only spent one week on this ...But we have But we have (Carl has)(Carl has) only spent one week on this ... only spent one week on this ...
The architecture will just exploit multicore processors The architecture will just exploit multicore processors automaticallyautomatically ... ... bring them on!bring them on!The architecture will just exploit multicore processors The architecture will just exploit multicore processors automaticallyautomatically ... ... bring them on!bring them on!
Apr 21, 2023 Copyright P.H.Welch 75
Conclusions and Future WorkConclusions and Future WorkConclusions and Future WorkConclusions and Future WorkDespite the simplicity of the current model, the emergent Despite the simplicity of the current model, the emergent behaviours observed are strikingly similar to behaviours observed are strikingly similar to haemostasishaemostasis..
Expand and refine the model, introducing new agent types and Expand and refine the model, introducing new agent types and rules to reflect closer and closer the real biology and physics.rules to reflect closer and closer the real biology and physics.
Multiple mechanisms for stimulating and inhibiting platelet Multiple mechanisms for stimulating and inhibiting platelet stickiness, sticky latency, other clot materials (fibrinogen), stickiness, sticky latency, other clot materials (fibrinogen), clot busting, differing platelet types, differing densities of clot busting, differing platelet types, differing densities of platelets within blood vessels, re-growth of the vessel wall platelets within blood vessels, re-growth of the vessel wall (under the clot), clot flexibility and tumbling, fluid dynamics, (under the clot), clot flexibility and tumbling, fluid dynamics, etc...etc...
Multiple mechanisms for stimulating and inhibiting platelet Multiple mechanisms for stimulating and inhibiting platelet stickiness, sticky latency, other clot materials (fibrinogen), stickiness, sticky latency, other clot materials (fibrinogen), clot busting, differing platelet types, differing densities of clot busting, differing platelet types, differing densities of platelets within blood vessels, re-growth of the vessel wall platelets within blood vessels, re-growth of the vessel wall (under the clot), clot flexibility and tumbling, fluid dynamics, (under the clot), clot flexibility and tumbling, fluid dynamics, etc...etc...
We invite We invite (and would really really like)(and would really really like) others to try this others to try this architecture for complex system modelling ... and whatever ...architecture for complex system modelling ... and whatever ...
Apr 21, 2023 Copyright P.H.Welch 76
AcknowledgementsAcknowledgementsAcknowledgementsAcknowledgementsThis work was part of that performed under the This work was part of that performed under the TUNATUNA pilot pilot study involving the Universities of York, Surrey and Kent. It study involving the Universities of York, Surrey and Kent. It was funded by the UK EPSRC from December, 2004, through was funded by the UK EPSRC from December, 2004, through December, 2006).December, 2006).
Many individuals contributed including: Susan Stepney, Jim Many individuals contributed including: Susan Stepney, Jim Woodcock, Ana Cavalcanti, Fiona Polack Woodcock, Ana Cavalcanti, Fiona Polack (York)(York), Steve , Steve Schneider, Helen Treharne Schneider, Helen Treharne (Surrey)(Surrey), Fred Barnes and Adam , Fred Barnes and Adam Sampson Sampson (Kent)(Kent)..
The work will continue under The work will continue under CoSMoSCoSMoS, a 4 year EPSRC grant , a 4 year EPSRC grant starting October, 2007. This will involve real science and real starting October, 2007. This will involve real science and real scientists!scientists!
Apr 21, 2023 Copyright P.H.Welch 77
Any q
uestion
s ... ???
Any q
uestion
s ... ???
Any q
uestion
s ... ???
Any q
uestion
s ... ???
Apr 21, 2023 Copyright P.H.Welch 78
Rapid Review: CSPRapid Review: CSPRapid Review: CSPRapid Review: CSP
We do not need to be mathematically sophisticated to work with CSP. That sophistication is pre-engineered That sophistication is pre-engineered into the model.into the model. We benefit from this simply by using it.
CSP deals with processes, networks of processes and various forms of synchronisation / communication between processes.
A network of processes is also a process - so CSP naturally accommodates layered network structures (networks of networks).
Apr 21, 2023 Copyright P.H.Welch 79
ProcessesProcessesProcessesProcesses
A process is a component that encapsulates some data structures and algorithms for manipulating that data.
Both its data and algorithms are private. The outside world can neither see that data nor execute those algorithms! [They are not [They are not objects …objects …] ] [Think [Think chips …chips …]]
The algorithms are executed by the process in its own thread (or threads) of control.
So, how does one process interact with another?
my.process
Apr 21, 2023 Copyright P.H.Welch 80
The simplest form of interaction is synchronised message-passing along channels.
The simplest forms of channel are zero-buffered and point-to-point (i.e. wireswires).
But, we can have buffered channels (blockingblocking//overwritingoverwriting).
And any-1, 1-any and any-any channels.
And structured multi-way synchronisationstructured multi-way synchronisation (e.g. barriers) …
And high-level (e.g. CREW) shared-memoryshared-memory locks locks …
ProcessesProcessesProcessesProcesses my.process
Apr 21, 2023 Copyright P.H.Welch 81
( A (c) || B (c) )( A (c) || B (c) ) \ {c} \ {c}
cAA BB
Synchronised CommunicationSynchronised CommunicationSynchronised CommunicationSynchronised Communication
BB may readread from cc at any time, but has to wait for a writewrite.
c ? x
AA may writewrite on cc at any time, but has to wait for a readread.
c ! 42
Apr 21, 2023 Copyright P.H.Welch 82
( A (c) || B (c) )( A (c) || B (c) ) \ {c} \ {c}
cAA BB
Synchronised CommunicationSynchronised CommunicationSynchronised CommunicationSynchronised Communication
Only when both AA and BB are ready can the communicationproceed over the channel cc.
c ? xc ! 42
Apr 21, 2023 Copyright P.H.Welch 83
The occam-occam- BARRIERBARRIER type corresponds to a multiway CSPCSP eventevent, though some higher level design patterns (such as resignationresignation) have been built in.
Barrier SynchronisationBarrier SynchronisationBarrier SynchronisationBarrier Synchronisation
bb
worker (0) worker (1) worker (n-1)∙∙∙
Basic CSPCSP semantics apply. When a process synchronisessynchronises on a barrier, it blocks until allall other processes enrolledenrolled on the barrier have also synchronisedsynchronised. Once the barrier has completed (i.e. all enrolledenrolled processes have synchronisedsynchronised), all blocked processes are rescheduled for execution.
Apr 21, 2023 Copyright P.H.Welch 84
PROC worker (VAL INT id, PROC worker (VAL INT id, BARRIER bBARRIER b, , cc)) ... local declarations / initialisation... local declarations / initialisation WHILE runningWHILE running SEQSEQ SYNC bSYNC b ... phase b computation... phase b computation SYNC cSYNC c ... phase c computation... phase c computation::
PROC worker (VAL INT id, PROC worker (VAL INT id, BARRIER BARRIER b)b) ... local declarations / initialisation... local declarations / initialisation WHILE runningWHILE running SEQSEQ SYNC bSYNC b ... phase 0 computation... phase 0 computation SYNC bSYNC b ... phase 1 computation... phase 1 computation::
Of course, only oneone barrier is actually needed to synchronise the phases in this example:
Barrier SynchronisationBarrier SynchronisationBarrier SynchronisationBarrier Synchronisation
Apr 21, 2023 Copyright P.H.Welch 85
Site and Agent InteractionSite and Agent InteractionSite and Agent InteractionSite and Agent Interaction
To swing down a chain of 1M1M sites, exchanging one INTINT during each visit: 770 770 nsecs/visit (P3), 280 280 nsecs/visit (P4)
To swing down a chain of 1M1M sites, exchanging one INTINT during each visit: 770 770 nsecs/visit (P3), 280 280 nsecs/visit (P4)
To swing down a chain of 1M1M sites, but doing no business: 450 450 nsecs/visit (P3), 120 120 nsecs/visit (P4)
To swing down a chain of 1M1M sites, but doing no business: 450 450 nsecs/visit (P3), 120 120 nsecs/visit (P4)
Apr 21, 2023 Copyright P.H.Welch 86
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
The The MatrixMatrixThe The
MatrixMatrix
Mobile Mobile AgentsAgentsMobile Mobile AgentsAgents
Apr 21, 2023 Copyright P.H.Welch 87
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
Apr 21, 2023 Copyright P.H.Welch 88
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
Apr 21, 2023 Copyright P.H.Welch 89
Location (Neighbourhood) AwarenessLocation (Neighbourhood) Awareness
Apr 21, 2023 Copyright P.H.Welch 90
PPPP
Dynamic Construction of AgentsDynamic Construction of AgentsDynamic Construction of AgentsDynamic Construction of Agents
bb
FORKINGFORKING XX
PP
Apr 21, 2023 Copyright P.H.Welch 91
bb
PP PPPP
Dynamic Construction of AgentsDynamic Construction of AgentsDynamic Construction of AgentsDynamic Construction of Agents
FORKINGFORKING XX
Apr 21, 2023 Copyright P.H.Welch 92
keyboardkeyboard
keywatch
drawdraw
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clot
Apr 21, 2023 Copyright P.H.Welch 93
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clot
phase 1
screenscreendisplay
Apr 21, 2023 Copyright P.H.Welch 94
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clotphase 0
Apr 21, 2023 Copyright P.H.Welch 95
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clotphase 0
Apr 21, 2023 Copyright P.H.Welch 96
phase 1
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clot
Apr 21, 2023 Copyright P.H.Welch 97
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clotphase 0
Apr 21, 2023 Copyright P.H.Welch 98
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
clotphase 0
Apr 21, 2023 Copyright P.H.Welch 99
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
phase 1
clotclot
Apr 21, 2023 Copyright P.H.Welch 100
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
phase 1
clotclot
Apr 21, 2023 Copyright P.H.Welch 101
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
phase 1
clotclot
Apr 21, 2023 Copyright P.H.Welch 102
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
phase 1
clotclot
Apr 21, 2023 Copyright P.H.Welch 103
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
phase 1
clot
Apr 21, 2023 Copyright P.H.Welch 104
Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)Platelet Model (‘lazy’ CA)
screenscreendisplay
keyboardkeyboard
keywatch
drawdraw
gen
∙∙∙∙∙∙ cell cellcell cell cellcell
phase 1
clot
Apr 21, 2023 Copyright P.H.Welch 105