330 likes | 354 Views
This paper presents a hybrid approach for a virtual biology multi-agent system, focusing on interaction between virtual cells and molecules. The implementation involves tissue morphogenesis and virtual growth, along with parallel implementation using OpenCL and a multi-agent system. It discusses methodologies to obtain new IDs for virtual cell instances and presents a proposed solution using atomic increments. The text emphasizes the importance of efficient memory management on parallel hardware and devices.
E N D
Gestionefficacedes ressourcesmémoire et de calculpour l’exécution desystème multi-agentssur architectures parallèlesavec OpenCL Lab-STICC, UMR 6285, CNRS, Dépt Informatique, Université de Brest Anne Jeannin-Girardon, Vincent Rodin Compas’2016, vincent.rodin@univ-brest.fr
Lab-STICC, CID, IHSEV Virtual Reality Virtual Biology Multi-Agent System approach Interaction betweenvirtualcellsand/or molecules
Context (2/3) Our approachishybrid • population level • (Molecular Virtual Chemistry) • individuallevel • (Virtual Cells)
Context (3/3) From a computational point of view, the workpresentedtodayis an improvement of • Anne Jeannin-GirardonPh.Dthesis, 2014 • Anne Jeannin-Girardon et al, IEEE/ACM Transaction on ComputationalBiology and Bioinformatics, 2015
Introduction • Morphogenesis & Dynamicity • Virtual Biological Model • Virtual Cell, Molecular Virtual Chemistry, Virtual Growth • Parallelimplementation • OpenCL, model coupledwith a MAS • How to get a new Id for a new Virtual Cell? • Results Outline
Tissue morphogenesis: Introduction (1/1) Tissularlevel processes • Is a multi-scalephenomenon • Can beaddressedthrough • continuous & discretemodels • Involvesmany of interacting • entities (cells, molecules, etc.) • Impliesbirth and death of cells • dynamicity Macroscopic scale Cell/Cell & cell/ECM interactions Mesoscopic scale Sub-cellular/ molecularprocesses Microscopic scale
Virtual Cell • Structure: mass/spring system • n+1 nodes • membrane, cytoskeleton, cortex • celldeformation Virtual Biological Model (1/3) • Mitose • orientatedmitosis • given an axis • Celladhesion/repulsion • differential interaction
Molecular Virtual Chemistry Molecularlevelmodelled with diffusion/reactionequations δi(x,t) δt DiΔi(x,t) – Ri(x,t) = Virtual Biological Model (2/3) • Set of molecules. Ex: {A, B,C} • Set of reactions. Ex: {2A + B C} • Set of 2D discretelayers. • One grid layer per molecule type • Equations solved in 2 steps: • 1) diffusion • 2) reaction
Virtual Growth produces Virtual Biological Model (3/3) consumes A TA TB B TD Dynamicity D TC C
Hey Vincent, do you know thatyou are not in a bioinformaticsconferencetoday?
Parallel hardware and device are everywhere • Parallelprograminggetseasier • Numerousparallelframeworks are available Parallelimplementation (1/2) • Our model seemswelladapted to parallelimplementation • Wechoose to use the OpenCLframeworkto implementit • wecan use CPUs, GPUs, FPGAs, etc.
Fine grainedimplementation: a cell = an OpenCLcore • model coupledwith a Multi-Agent System Parallelimplementation (2/2) Kernel k1: computes forces Kernel k2: integrates forces (Euler method) • Data storedinto structures of arrays: nodes, etc. • adapted data structure for OpenCL: a cell = an id • Question: How to find a new Id for a new Virtual Cell?
N (± 106) Virtual Cells : structures of arrays How to get a new Id ? (1/3) 0 1 2 N-1 Active or Inactive Node 0 Node 1 Node 5 Node C Etc. At the beginning of the simulation… easy!
N (± 106) Virtual Cells : structures of arrays How to get a new Id ? (1/3) 0 1 2 N-1 Active or Inactive Node 0 Node 1 Node 5 Node C Etc. Afterbirths and deaths….?
Somepreviousworks (1): [Lysenko & D’Souza, 2008] 0 1 2 N-1 How to get a new Id ? (2/3) Active or Inactive Attributes A stochasticmethod: A randomchoisehappens… …until an inactive elementisobtained! Main drawback: What appends if the memoryisnearly full?
Somepreviousworks (2): [Jeannin-Girardon, Ph.D, 2014] [Jeannin-Girardon et al, TCBB, 2015] 0 1 2 N-1 How to get a new Id ? (2/3) Active or Inactive Attributes A hybridmethod: Dynamicswitch : StochasticMethod & Parallel Sort
Somepreviousworks (2): [Jeannin-Girardon, Ph.D, 2014] [Jeannin-Girardon et al, TCBB, 2015] 0 1 2 N-1 0 1 2 N-1 How to get a new Id ? (2/3) Active or Inactive Attributes A hybridmethod: Dynamicswitch : StochasticMethod & Parallel Sort Main drawbacks: - How to choose the thresholds to switch? - Parallel sort… data transfers
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation 0 1 2 3 … … … … … … … … N-1 Deallocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 1 2 3 … … … … … … … … N-1 Deallocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 -1 2 3 … … … … … … … … N-1 Deallocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 -1 -1 3 … … … … … … … … N-1 Deallocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 -1 -1 3 … … … … … … … … N-1 Deallocation 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 -1 -1 3 … … … … … … … … N-1 Deallocation 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 -1 -1 3 … … … … … … … … N-1 Deallocation 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation -1 -1 -1 3 … … … … … … … … N-1 Deallocation 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 SWAP Allocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Deallocation 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (1): [Jeannin-Girardon et al, Compas, 2016] 0 1 2 N-1 How to get a new Id ? (3/3) Active or Inactive Attributes Available Indexes are stored in two buffers & atomic_inc PtrAllocation 0 1 2 N-1 Allocation 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Deallocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (2): [Jeannin-Girardon et al, Compas, 2016] res = atomic_inc(var):OpenCLatomicoperation tmp=var; var++; return tmp How to get a new Id ? (3/3) Deallocation: Ptr = atomic_inc(PtrDeallocation) Desallocation[Ptr] = Id Allocation: Ptr = atomic_inc(PtrAllocation) If Ptr < N and Allocation[Ptr] != -1 Then Id = Allocation[Ptr] Allocation[Ptr] = -1 Return Id Endif PtrAllocation 0 1 2 N-1 Allocation 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Deallocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrDeallocation
Our proposition (3): [Jeannin-Girardon et al, Compas, 2016] Swap conditions: PtrAllocation How to get a new Id ? (3/3) 0 1 2 N-1 SWAP Allocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 Deallocation 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 PtrAllocation 0 1 2 N-1 Allocation -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 SWAP Deallocation 3 5 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
Prey-Predator model Results: Prey-Predator model (1/2) High dynamicity…
Results: Prey-Predator model (2/2) Hybridmethod Double buffer method