SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
PySense
    Python Decorators for Wireless Sensor Macroprogramming




Davide Carboni,
ICSOFT 2010, Athens 22-24 April

                                                             1
Who, where...




                        geoweb.crs4.it
                        twitter.com/__dadaista__

locative sensor web ubicomp web of things mobile
                                               2 2
wireless sensor
           networking today


                communication
communication
                                computation




                                              3
wireless sensor
                computing

                                       computation--

                   communication--
 communication--


computation++



                                     computation++
                                                       4
Decentralization

• In today cloud computing
  “computation costs less then
  storage” → “move the
  computation to data”
• In today wireless networks
  “computation costs less then
  communication” → move the
  computation to data (sensors)

                                  5
Decentralization

• Wireless Sensor Computing
  – not only simple sensors connected to
    a central computer, but rather
    elements capable of computation
    in a distributed system
• Computation Vs Communication
  – One byte sent demands 100 times
    the energy of an integer instruction


                                           6
Programming models

• Node-level programming
  – program for each node type (error
    prone, difficult, only for experts)
• Network as DB
  – Good but limited to queries (TinyDB)
• Macroprogramming
  – Program the net as a whole, the
    middleware partition the code on the
    nodes automatically
                                           7
Use case

• given an energy consumption
  model E and an application code C,
  there exists a partitioning of code
  C={c1,c2,...,cn} and a set Tx of
  transmissions Tx={tx1,tx2,...,txk}
  which is optimal for E



                                        8
PySense

• What is PySense
  – A programming model for Python
  – A middleware based on Python
    decorators and API
  – It runs on:
    • Base Runtime Environment (based on
      Python 2.6)
    • Remote Runtime Environment (based on
      Python-on-a-chip)

                                             9
What is not PySense

• Not ready to use solution
• Not bound to a specific network
  topology (mesh, clustering, ...) or
  network protocol stack
  (zigbee,tcp,...)
• Not efficient in terms of memory
  used by nodes


                                        10
Motivation

• Python:
  – easy to use,
  – easy to learn,
  – rapid prototyping
                        And because we
                        like to go beyond
                             the limits



                                            11
What is a python
          decorator

Syntactic sugar
@foo
def f(x):<implementation>

Equivalent to call
foo(f)
where foo returns a function

                               12
What is a python
           decorator
def foo(func):
    def my_f(*args):
         do_something_pre()
         func(*args)
         do_something_post()
    return my_f

@foo
def f(x):
     return x*x

                               13
Elements of PySense

•   Region
•   Group
•   @mote
•   @onboard
•   @onbase
•   @auto


                                 14
PySense Regions

Region(“/(0,0,100,100)”) | Region(“/foo/3/312”)




                                                  15
@mote

@mote
class M:
  def getX(self):pass
  def setY(self,y):pass

           Finds a mote m with X,Y
m=M()
m.getX()        Read X from m, translated
                 in a network message
                  from the invoker to m
                                            16
@mote                         Translated into
class M:                   a network message:
   def getX(self):pass    TO <addr> CALL f x,y,...

   @onboard
   def f(self,args):<code to move on node>

   @onbase
   def g(self,args):<code to run on base>

   @auto
   def h(self,args):<some code>

                                                     17
Simple program

r=Region(“/somewhere”) #somewhere
@mote
class CO2Sense:
  def getConc(self): A lot of long range messages
    pass               exchanged between base
                               and remotes

values=
[c.getConc() for c in r.items(CO2Sense)]
avg = sum(values)/len(values)

                                                    18
A little better

@mote
class CO2Sense:
  def getConc(self):pass     The avg () will be run
                             In one remote elected
class CO2Group(Group):           head of group
  @onboard
  def avg(self):
    return sum([m.getConc() for m in self.motes])
/ len(self.motes)
                                        Short range
                                         messages
avg=CO2Group(r.items(CO2Sense)).avg()

                                                      19
Where we are

• API and decorators implemented
  and tested on PC processes
  running python-on-a-chip
  interpreter and pipes for I/O
• Todo:
 – @auto
 – Deployment on real boards … we
   want a real test bed not simulation

                                         20
A lot to do

• Approach #1       Hey … this is a position paper

 – running a VM and interpreter on the
   mote
 – Memory demanding
• Approach #2
 – Compiling @onboard python on native
   code
 – Need OTA reconf

                                                     21
VM on board

           MBED board
           64KB RAM
          Clock 100MHz
          USB, ETH, ...




               Running python
                  and HTTP
              is too demanding


                                 22
Questions & Answers




                      23

Más contenido relacionado

La actualidad más candente

DIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe WorkshopDIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe Workshopodsc
 
Lzw compression ppt
Lzw compression pptLzw compression ppt
Lzw compression pptRabia Nazir
 
2014 valat-phd-defense-slides
2014 valat-phd-defense-slides2014 valat-phd-defense-slides
2014 valat-phd-defense-slidesSébastien Valat
 
Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonRalf Gommers
 
NUMA-aware Scalable Graph Traversal on SGI UV Systems
NUMA-aware Scalable Graph Traversal on SGI UV SystemsNUMA-aware Scalable Graph Traversal on SGI UV Systems
NUMA-aware Scalable Graph Traversal on SGI UV SystemsYuichiro Yasui
 
PyData NYC whatsnew NumPy-SciPy 2019
PyData NYC whatsnew NumPy-SciPy 2019PyData NYC whatsnew NumPy-SciPy 2019
PyData NYC whatsnew NumPy-SciPy 2019Ralf Gommers
 
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...ijsrd.com
 
Python at Ordnance Survey
Python at Ordnance SurveyPython at Ordnance Survey
Python at Ordnance SurveyOliviaWilson3
 
Linux and Open Source in Math, Science and Engineering
Linux and Open Source in Math, Science and EngineeringLinux and Open Source in Math, Science and Engineering
Linux and Open Source in Math, Science and EngineeringPDE1D
 
HTCC poster for CERN Openlab opendays 2015
HTCC poster for CERN Openlab opendays 2015HTCC poster for CERN Openlab opendays 2015
HTCC poster for CERN Openlab opendays 2015Karel Ha
 
Fast and Scalable NUMA-based Thread Parallel Breadth-first Search
Fast and Scalable NUMA-based Thread Parallel Breadth-first SearchFast and Scalable NUMA-based Thread Parallel Breadth-first Search
Fast and Scalable NUMA-based Thread Parallel Breadth-first SearchYuichiro Yasui
 
A peek on numerical programming in perl and python e christopher dyken 2005
A peek on numerical programming in perl and python  e christopher dyken  2005A peek on numerical programming in perl and python  e christopher dyken  2005
A peek on numerical programming in perl and python e christopher dyken 2005Jules Krdenas
 
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14Yuichiro Yasui
 
The Joy of SciPy
The Joy of SciPyThe Joy of SciPy
The Joy of SciPykammeyer
 
LEGaTO: Software Stack Runtimes
LEGaTO: Software Stack RuntimesLEGaTO: Software Stack Runtimes
LEGaTO: Software Stack RuntimesLEGATO project
 

La actualidad más candente (20)

MPEG-4 BIFS Overview
MPEG-4 BIFS OverviewMPEG-4 BIFS Overview
MPEG-4 BIFS Overview
 
DIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe WorkshopDIY Deep Learning with Caffe Workshop
DIY Deep Learning with Caffe Workshop
 
Lzw compression ppt
Lzw compression pptLzw compression ppt
Lzw compression ppt
 
2014 valat-phd-defense-slides
2014 valat-phd-defense-slides2014 valat-phd-defense-slides
2014 valat-phd-defense-slides
 
Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for Python
 
NUMA-aware Scalable Graph Traversal on SGI UV Systems
NUMA-aware Scalable Graph Traversal on SGI UV SystemsNUMA-aware Scalable Graph Traversal on SGI UV Systems
NUMA-aware Scalable Graph Traversal on SGI UV Systems
 
PyData NYC whatsnew NumPy-SciPy 2019
PyData NYC whatsnew NumPy-SciPy 2019PyData NYC whatsnew NumPy-SciPy 2019
PyData NYC whatsnew NumPy-SciPy 2019
 
Paralell
ParalellParalell
Paralell
 
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
 
Python at Ordnance Survey
Python at Ordnance SurveyPython at Ordnance Survey
Python at Ordnance Survey
 
Available HPC resources at CSUC
Available HPC resources at CSUCAvailable HPC resources at CSUC
Available HPC resources at CSUC
 
Linux and Open Source in Math, Science and Engineering
Linux and Open Source in Math, Science and EngineeringLinux and Open Source in Math, Science and Engineering
Linux and Open Source in Math, Science and Engineering
 
HTCC poster for CERN Openlab opendays 2015
HTCC poster for CERN Openlab opendays 2015HTCC poster for CERN Openlab opendays 2015
HTCC poster for CERN Openlab opendays 2015
 
Fast and Scalable NUMA-based Thread Parallel Breadth-first Search
Fast and Scalable NUMA-based Thread Parallel Breadth-first SearchFast and Scalable NUMA-based Thread Parallel Breadth-first Search
Fast and Scalable NUMA-based Thread Parallel Breadth-first Search
 
A peek on numerical programming in perl and python e christopher dyken 2005
A peek on numerical programming in perl and python  e christopher dyken  2005A peek on numerical programming in perl and python  e christopher dyken  2005
A peek on numerical programming in perl and python e christopher dyken 2005
 
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
Graph500 and Green Graph500 benchmarks on SGI UV2000 @ SGI UG SC14
 
The Joy of SciPy
The Joy of SciPyThe Joy of SciPy
The Joy of SciPy
 
Lzw coding technique for image compression
Lzw coding technique for image compressionLzw coding technique for image compression
Lzw coding technique for image compression
 
LEGaTO: Software Stack Runtimes
LEGaTO: Software Stack RuntimesLEGaTO: Software Stack Runtimes
LEGaTO: Software Stack Runtimes
 
TensorFlow Object Detection API
TensorFlow Object Detection APITensorFlow Object Detection API
TensorFlow Object Detection API
 

Similar a Python Decorators for Wireless Sensor Macroprogramming

Scaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUsScaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUsTravis Oliphant
 
Natural Language Processing with CNTK and Apache Spark with Ali Zaidi
Natural Language Processing with CNTK and Apache Spark with Ali ZaidiNatural Language Processing with CNTK and Apache Spark with Ali Zaidi
Natural Language Processing with CNTK and Apache Spark with Ali ZaidiDatabricks
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectMatthew Gerring
 
IS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorialIS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorialRoger Rafanell Mas
 
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) OverviewNaoki (Neo) SATO
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
On the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of PythonOn the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of PythonTakeshi Akutsu
 
On the necessity and inapplicability of python
On the necessity and inapplicability of pythonOn the necessity and inapplicability of python
On the necessity and inapplicability of pythonYung-Yu Chen
 
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesPerformance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesDr. Fabio Baruffa
 
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)Igalia
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...Alexandre Moneger
 
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...Marcello Tomasini
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Fwdays
 
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Amazon Web Services
 

Similar a Python Decorators for Wireless Sensor Macroprogramming (20)

Scaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUsScaling Python to CPUs and GPUs
Scaling Python to CPUs and GPUs
 
EEDC Programming Models
EEDC Programming ModelsEEDC Programming Models
EEDC Programming Models
 
Natural Language Processing with CNTK and Apache Spark with Ali Zaidi
Natural Language Processing with CNTK and Apache Spark with Ali ZaidiNatural Language Processing with CNTK and Apache Spark with Ali Zaidi
Natural Language Processing with CNTK and Apache Spark with Ali Zaidi
 
MXNet Workshop
MXNet WorkshopMXNet Workshop
MXNet Workshop
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0An Introduction to OMNeT++ 6.0
An Introduction to OMNeT++ 6.0
 
IS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorialIS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorial
 
25-MPI-OpenMP.pptx
25-MPI-OpenMP.pptx25-MPI-OpenMP.pptx
25-MPI-OpenMP.pptx
 
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
mpi4py.pdf
mpi4py.pdfmpi4py.pdf
mpi4py.pdf
 
On the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of PythonOn the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of Python
 
On the necessity and inapplicability of python
On the necessity and inapplicability of pythonOn the necessity and inapplicability of python
On the necessity and inapplicability of python
 
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesPerformance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
 
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
D. Fast, Simple User-Space Network Functions with Snabb (RIPE 77)
 
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
 
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"
 
Tms320 f2812
Tms320 f2812Tms320 f2812
Tms320 f2812
 
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
Scalable Deep Learning on AWS Using Apache MXNet - AWS Summit Tel Aviv 2017
 

Más de Davide Carboni

PPT-CyberJourney-June-2023-Carboni.pptx
PPT-CyberJourney-June-2023-Carboni.pptxPPT-CyberJourney-June-2023-Carboni.pptx
PPT-CyberJourney-June-2023-Carboni.pptxDavide Carboni
 
From Smart Contracts to NFT
 From Smart Contracts to NFT From Smart Contracts to NFT
From Smart Contracts to NFTDavide Carboni
 
Blockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdfBlockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdfDavide Carboni
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)Davide Carboni
 
Internet-of-things, sicurezza, privacy, trust
Internet-of-things, sicurezza, privacy, trustInternet-of-things, sicurezza, privacy, trust
Internet-of-things, sicurezza, privacy, trustDavide Carboni
 
Blockchain - crittomonete, Bitcoin e altre applicazioni
Blockchain - crittomonete, Bitcoin e altre applicazioniBlockchain - crittomonete, Bitcoin e altre applicazioni
Blockchain - crittomonete, Bitcoin e altre applicazioniDavide Carboni
 
Internet of Things al Festivalscienza 2010
Internet of Things al Festivalscienza 2010Internet of Things al Festivalscienza 2010
Internet of Things al Festivalscienza 2010Davide Carboni
 
Introduzione ai Design Patterns nella Programmazione a Oggetti
Introduzione ai Design Patterns nella Programmazione a OggettiIntroduzione ai Design Patterns nella Programmazione a Oggetti
Introduzione ai Design Patterns nella Programmazione a OggettiDavide Carboni
 
Browsing Large Collections of Geo-Tagged Pictures
Browsing Large Collections of Geo-Tagged PicturesBrowsing Large Collections of Geo-Tagged Pictures
Browsing Large Collections of Geo-Tagged PicturesDavide Carboni
 
Programmazione concorrente in Java (vecchio modello)
Programmazione concorrente in Java (vecchio modello)Programmazione concorrente in Java (vecchio modello)
Programmazione concorrente in Java (vecchio modello)Davide Carboni
 
Kickoff del Progetto Cluster Mashup e Geoweb
Kickoff del Progetto Cluster Mashup e GeowebKickoff del Progetto Cluster Mashup e Geoweb
Kickoff del Progetto Cluster Mashup e GeowebDavide Carboni
 
Open al bivio fra software e webware (al javaday 2006)
Open al bivio fra software e webware (al javaday 2006)Open al bivio fra software e webware (al javaday 2006)
Open al bivio fra software e webware (al javaday 2006)Davide Carboni
 
Web 2.0, mashup e GeoWeb
Web 2.0, mashup e GeoWebWeb 2.0, mashup e GeoWeb
Web 2.0, mashup e GeoWebDavide Carboni
 
Open al bivio fra software e webware
Open al bivio fra software e webwareOpen al bivio fra software e webware
Open al bivio fra software e webwareDavide Carboni
 

Más de Davide Carboni (20)

PPT-CyberJourney-June-2023-Carboni.pptx
PPT-CyberJourney-June-2023-Carboni.pptxPPT-CyberJourney-June-2023-Carboni.pptx
PPT-CyberJourney-June-2023-Carboni.pptx
 
From Smart Contracts to NFT
 From Smart Contracts to NFT From Smart Contracts to NFT
From Smart Contracts to NFT
 
Blockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdfBlockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdf
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)
 
Internet-of-things, sicurezza, privacy, trust
Internet-of-things, sicurezza, privacy, trustInternet-of-things, sicurezza, privacy, trust
Internet-of-things, sicurezza, privacy, trust
 
Blockchain - crittomonete, Bitcoin e altre applicazioni
Blockchain - crittomonete, Bitcoin e altre applicazioniBlockchain - crittomonete, Bitcoin e altre applicazioni
Blockchain - crittomonete, Bitcoin e altre applicazioni
 
08 mapreduce
08   mapreduce08   mapreduce
08 mapreduce
 
04 bloom
04 bloom04 bloom
04 bloom
 
2 phase-commit
 2 phase-commit 2 phase-commit
2 phase-commit
 
Internet of Things al Festivalscienza 2010
Internet of Things al Festivalscienza 2010Internet of Things al Festivalscienza 2010
Internet of Things al Festivalscienza 2010
 
Introduzione ai Design Patterns nella Programmazione a Oggetti
Introduzione ai Design Patterns nella Programmazione a OggettiIntroduzione ai Design Patterns nella Programmazione a Oggetti
Introduzione ai Design Patterns nella Programmazione a Oggetti
 
Browsing Large Collections of Geo-Tagged Pictures
Browsing Large Collections of Geo-Tagged PicturesBrowsing Large Collections of Geo-Tagged Pictures
Browsing Large Collections of Geo-Tagged Pictures
 
Programmazione concorrente in Java (vecchio modello)
Programmazione concorrente in Java (vecchio modello)Programmazione concorrente in Java (vecchio modello)
Programmazione concorrente in Java (vecchio modello)
 
NAT Traversal
NAT TraversalNAT Traversal
NAT Traversal
 
Introduction P2p
Introduction P2pIntroduction P2p
Introduction P2p
 
Spoleto07
Spoleto07Spoleto07
Spoleto07
 
Kickoff del Progetto Cluster Mashup e Geoweb
Kickoff del Progetto Cluster Mashup e GeowebKickoff del Progetto Cluster Mashup e Geoweb
Kickoff del Progetto Cluster Mashup e Geoweb
 
Open al bivio fra software e webware (al javaday 2006)
Open al bivio fra software e webware (al javaday 2006)Open al bivio fra software e webware (al javaday 2006)
Open al bivio fra software e webware (al javaday 2006)
 
Web 2.0, mashup e GeoWeb
Web 2.0, mashup e GeoWebWeb 2.0, mashup e GeoWeb
Web 2.0, mashup e GeoWeb
 
Open al bivio fra software e webware
Open al bivio fra software e webwareOpen al bivio fra software e webware
Open al bivio fra software e webware
 

Último

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 

Último (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 

Python Decorators for Wireless Sensor Macroprogramming

  • 1. PySense Python Decorators for Wireless Sensor Macroprogramming Davide Carboni, ICSOFT 2010, Athens 22-24 April 1
  • 2. Who, where... geoweb.crs4.it twitter.com/__dadaista__ locative sensor web ubicomp web of things mobile 2 2
  • 3. wireless sensor networking today communication communication computation 3
  • 4. wireless sensor computing computation-- communication-- communication-- computation++ computation++ 4
  • 5. Decentralization • In today cloud computing “computation costs less then storage” → “move the computation to data” • In today wireless networks “computation costs less then communication” → move the computation to data (sensors) 5
  • 6. Decentralization • Wireless Sensor Computing – not only simple sensors connected to a central computer, but rather elements capable of computation in a distributed system • Computation Vs Communication – One byte sent demands 100 times the energy of an integer instruction 6
  • 7. Programming models • Node-level programming – program for each node type (error prone, difficult, only for experts) • Network as DB – Good but limited to queries (TinyDB) • Macroprogramming – Program the net as a whole, the middleware partition the code on the nodes automatically 7
  • 8. Use case • given an energy consumption model E and an application code C, there exists a partitioning of code C={c1,c2,...,cn} and a set Tx of transmissions Tx={tx1,tx2,...,txk} which is optimal for E 8
  • 9. PySense • What is PySense – A programming model for Python – A middleware based on Python decorators and API – It runs on: • Base Runtime Environment (based on Python 2.6) • Remote Runtime Environment (based on Python-on-a-chip) 9
  • 10. What is not PySense • Not ready to use solution • Not bound to a specific network topology (mesh, clustering, ...) or network protocol stack (zigbee,tcp,...) • Not efficient in terms of memory used by nodes 10
  • 11. Motivation • Python: – easy to use, – easy to learn, – rapid prototyping And because we like to go beyond the limits 11
  • 12. What is a python decorator Syntactic sugar @foo def f(x):<implementation> Equivalent to call foo(f) where foo returns a function 12
  • 13. What is a python decorator def foo(func): def my_f(*args): do_something_pre() func(*args) do_something_post() return my_f @foo def f(x): return x*x 13
  • 14. Elements of PySense • Region • Group • @mote • @onboard • @onbase • @auto 14
  • 16. @mote @mote class M: def getX(self):pass def setY(self,y):pass Finds a mote m with X,Y m=M() m.getX() Read X from m, translated in a network message from the invoker to m 16
  • 17. @mote Translated into class M: a network message: def getX(self):pass TO <addr> CALL f x,y,... @onboard def f(self,args):<code to move on node> @onbase def g(self,args):<code to run on base> @auto def h(self,args):<some code> 17
  • 18. Simple program r=Region(“/somewhere”) #somewhere @mote class CO2Sense: def getConc(self): A lot of long range messages pass exchanged between base and remotes values= [c.getConc() for c in r.items(CO2Sense)] avg = sum(values)/len(values) 18
  • 19. A little better @mote class CO2Sense: def getConc(self):pass The avg () will be run In one remote elected class CO2Group(Group): head of group @onboard def avg(self): return sum([m.getConc() for m in self.motes]) / len(self.motes) Short range messages avg=CO2Group(r.items(CO2Sense)).avg() 19
  • 20. Where we are • API and decorators implemented and tested on PC processes running python-on-a-chip interpreter and pipes for I/O • Todo: – @auto – Deployment on real boards … we want a real test bed not simulation 20
  • 21. A lot to do • Approach #1 Hey … this is a position paper – running a VM and interpreter on the mote – Memory demanding • Approach #2 – Compiling @onboard python on native code – Need OTA reconf 21
  • 22. VM on board MBED board 64KB RAM Clock 100MHz USB, ETH, ... Running python and HTTP is too demanding 22