SlideShare une entreprise Scribd logo
1  sur  18
Tecnológico de Monterrey !
                                                       campus Guadalajara!



01/02/2008!   Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                    !      1!
Contenido!

 1.           Marco Contextual!

 2.           Construcción del modelo visual!

 3.           Validación con RdP y Optimización de código base!

 4.           Generación de código!

 5.           Conclusiones!




01/02/2008!               Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                !   2!
Objetivo!


Crear un ambiente de programación visual que facilite el
modelado de sistemas paralelos y la enseñanza de cómputo
paralelo y multicore:!

Proporcionando para ello un ambiente de desarrollo capaz de
generar código textual paralelo optimizado a partir de un modelo
visual de la aplicación. !




01/02/2008!        Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                         !   3!
01/02/2008!   Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                    !   4!
Introduction!


•  The use of a traditional language to develop parallel programs is
   not that simple. This Eclipse plug-in is focused on facilitating
   teaching/learning techniques and implications of parallel,
   concurrent and multicore computing. !

•  How to improve the way in which we develop parallel
   computing?. How can we make this process easier?. Using a
   development environment which generate parallel textual code
   having as base a visual model of the system. Event though it
   canʼt warranty the best parallel solution it can warranty a
   functional solution.!




01/02/2008!         Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                          !   5!
Introducción!
Modelo visual a RdPM
    para su análisis y
         optimización!

        !De la RdPM a
     pseudocódigo, el
  cuál será convertido
       a código fuente
  para una plataforma
             particular.!




   01/02/2008!              Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                  !   6!
Modelo visual!


•  Se utiliza un lenguaje visual donde los programas son
   construidos mediante iconos, conectores y elementos de
   texto para crear expresiones multidimensionales.!

•  Cada icono en el grafo representa una entidad diferente:
   estructura de control de flujo, datos o atributos.!

•  Existen dos tipos de conectores, los cuales definen dos
   tipos de flujo: ejecución y control.!




01/02/2008!      Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                       !   7!
Modelo visual!

Clasificación de actores:!
           Secuenciales !
          Condicionales !
                Ciclos y!
         Control de flujo!




     01/02/2008!            Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                  !   8!
Validación!
•  El flujo de ejecución se analiza al momento de interconectar los
   elementos empleando análisis incremental.!

•  Se garantiza que los elementos sean correctos y que estén
   conectados de forma correcta en todo momento.!

•  El flujo de control está conformado por iconos de control
   (semáforos, candados, et al) y conectores.!

•  Se aplica el método de reachability tree a la RdP para
   garantizar que es correcta y se aplican técnicas de fusión para
   reducir el modelo.!


01/02/2008!         Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                          !   9!
Validación!
     El modelo visual es
     transformado a una
                   RdP.!

   La RdP representa la
        ejecución (tanto
       secuencial como
   concurrente) y el flujo
              de control
        (sincronización,
  semáforos, candados,
                     etc.)!

La RdP define el modelo
     formal del sistema.!




   01/02/2008!                Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                    !   10!
Validación!
 !Si la RdP satisface
   las características
  de alcanzabilidad y
vivacidad, el modelo
         es correcto.!




   01/02/2008!           Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                               !   11!
Optimización!

El modelo formal puede ser optimizado. La optimización !
incluye:!

•  Analizar la dependencia de datos. Para esto se utiliza el grafo
   subjacente a la RdP. Se intenta asegurar la disponibilidad de
   datos en cada nodo así cuidar los accesos concurrentes a datos
   compartidos. !

•  Añadir iconos de control. Analizar la dependencia de datos
   permite identificar la necesidad de elementos de control como
   apoyo al cuidado de los accesos concurrentes a datos
   compartidos.!

01/02/2008!        Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                         !   12!
Optimización!

•  Reducción de secuencias y fusión.!
   El número máximo de hilos a generar está predefinido.!


         La reducción del modelo
 facilita el análisis e impacta en
la cantidad de líneas de codigo
                que se generará.

Las propiedades de seguridad,
  alcanzabilidad y vivacidad se
                    conservan.




01/02/2008!               Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                !   13!
Optimización!


   !For a N value given
           in a node, it is
      establish a parallel
     cyclic structure that
       allows to chunk a
                     task.!




01/02/2008!                   Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                    !   14!
Results!
•  Code generation!

•  Once we have the Petri net and weʼd optimized that net, we
   could transform it into a base code. Using this base code we
   would obtain the final code.!

•  Base code or pseudo code consists on a textual expression of
   the MPN of the system. !

•  Model projection: the textual representation of actors and
   trajectories are mapped to a programming language using
   parallel and multicore libraries to a pre-established architecture:
   distributed system, parallel system or multicore system.!



01/02/2008!          Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                           !   15!
Results!

!MPN structure with all
 its data in places and
           transitions is
 converted into a plain
     text (pseudo-code
         file), this file is
           distributed in
   scenarios and each
  scenario is divided in
       five code zones:
 global data, modules,
     actors and control
    and execution flow
         specifications.  !




 01/02/2008!                 Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                                   !   16!
Results!

              !Zones
  distribution at
  the file of the
        resultant
  source code.  !




01/02/2008!            Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                             !   17!
Conclusion!

•  This visual plug-in allows:!

•  An easiest design and a better way to check for grammatical
   errors.!

•  To validate your system through a formal tool.!

•  To generate standard, ordered and reliable code.!

•  Parallelism optimization. Even though this parallelism
   optimization could be limited by semantics, it is a good approach
   which will increase the systemsʼ performance according with
   Amdahl law.!


01/02/2008!          Javier González Sánchez y Maria Elena Chavez Echeagaray
                                                                           !   18!

Contenu connexe

En vedette

En vedette (17)

Sociale media en journalistiek
Sociale media en journalistiekSociale media en journalistiek
Sociale media en journalistiek
 
Valvuloplastie
ValvuloplastieValvuloplastie
Valvuloplastie
 
199912 outsight
199912 outsight199912 outsight
199912 outsight
 
201006 its tutorial
201006 its tutorial201006 its tutorial
201006 its tutorial
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
2013 cch basic principles ch04
2013 cch basic principles ch042013 cch basic principles ch04
2013 cch basic principles ch04
 
A73A CQWW 2012 Contest operation from the Desert of Qatar
A73A CQWW 2012 Contest operation from the Desert of QatarA73A CQWW 2012 Contest operation from the Desert of Qatar
A73A CQWW 2012 Contest operation from the Desert of Qatar
 
200910 - iPhone at OOPSLA
200910 - iPhone at OOPSLA200910 - iPhone at OOPSLA
200910 - iPhone at OOPSLA
 
201003 Alice (part 1/15)
201003 Alice (part 1/15)201003 Alice (part 1/15)
201003 Alice (part 1/15)
 
Team Visit
Team VisitTeam Visit
Team Visit
 
New Venture Presentatie
New Venture PresentatieNew Venture Presentatie
New Venture Presentatie
 
Itf ipp ch08_2012_final
Itf ipp ch08_2012_finalItf ipp ch08_2012_final
Itf ipp ch08_2012_final
 
Presentation
PresentationPresentation
Presentation
 
Lowering barriers to publishing biological data on the web
Lowering barriers to publishing biological data on the webLowering barriers to publishing biological data on the web
Lowering barriers to publishing biological data on the web
 
VU 19 Nov 09
VU 19  Nov 09VU 19  Nov 09
VU 19 Nov 09
 
201506 CSE340 Lecture 23
201506 CSE340 Lecture 23201506 CSE340 Lecture 23
201506 CSE340 Lecture 23
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 

Plus de Javier Gonzalez-Sanchez (20)

201804 SER332 Lecture 01
201804 SER332 Lecture 01201804 SER332 Lecture 01
201804 SER332 Lecture 01
 
201801 SER332 Lecture 03
201801 SER332 Lecture 03201801 SER332 Lecture 03
201801 SER332 Lecture 03
 
201801 SER332 Lecture 04
201801 SER332 Lecture 04201801 SER332 Lecture 04
201801 SER332 Lecture 04
 
201801 SER332 Lecture 02
201801 SER332 Lecture 02201801 SER332 Lecture 02
201801 SER332 Lecture 02
 
201801 CSE240 Lecture 26
201801 CSE240 Lecture 26201801 CSE240 Lecture 26
201801 CSE240 Lecture 26
 
201801 CSE240 Lecture 25
201801 CSE240 Lecture 25201801 CSE240 Lecture 25
201801 CSE240 Lecture 25
 
201801 CSE240 Lecture 24
201801 CSE240 Lecture 24201801 CSE240 Lecture 24
201801 CSE240 Lecture 24
 
201801 CSE240 Lecture 23
201801 CSE240 Lecture 23201801 CSE240 Lecture 23
201801 CSE240 Lecture 23
 
201801 CSE240 Lecture 22
201801 CSE240 Lecture 22201801 CSE240 Lecture 22
201801 CSE240 Lecture 22
 
201801 CSE240 Lecture 21
201801 CSE240 Lecture 21201801 CSE240 Lecture 21
201801 CSE240 Lecture 21
 
201801 CSE240 Lecture 20
201801 CSE240 Lecture 20201801 CSE240 Lecture 20
201801 CSE240 Lecture 20
 
201801 CSE240 Lecture 19
201801 CSE240 Lecture 19201801 CSE240 Lecture 19
201801 CSE240 Lecture 19
 
201801 CSE240 Lecture 18
201801 CSE240 Lecture 18201801 CSE240 Lecture 18
201801 CSE240 Lecture 18
 
201801 CSE240 Lecture 17
201801 CSE240 Lecture 17201801 CSE240 Lecture 17
201801 CSE240 Lecture 17
 
201801 CSE240 Lecture 16
201801 CSE240 Lecture 16201801 CSE240 Lecture 16
201801 CSE240 Lecture 16
 
201801 CSE240 Lecture 15
201801 CSE240 Lecture 15201801 CSE240 Lecture 15
201801 CSE240 Lecture 15
 
201801 CSE240 Lecture 14
201801 CSE240 Lecture 14201801 CSE240 Lecture 14
201801 CSE240 Lecture 14
 
201801 CSE240 Lecture 13
201801 CSE240 Lecture 13201801 CSE240 Lecture 13
201801 CSE240 Lecture 13
 
201801 CSE240 Lecture 12
201801 CSE240 Lecture 12201801 CSE240 Lecture 12
201801 CSE240 Lecture 12
 
201801 CSE240 Lecture 11
201801 CSE240 Lecture 11201801 CSE240 Lecture 11
201801 CSE240 Lecture 11
 

200801 Generating OpenMP and Pthreads code

  • 1. Tecnológico de Monterrey ! campus Guadalajara! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 1!
  • 2. Contenido! 1.  Marco Contextual! 2.  Construcción del modelo visual! 3.  Validación con RdP y Optimización de código base! 4.  Generación de código! 5.  Conclusiones! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 2!
  • 3. Objetivo! Crear un ambiente de programación visual que facilite el modelado de sistemas paralelos y la enseñanza de cómputo paralelo y multicore:! Proporcionando para ello un ambiente de desarrollo capaz de generar código textual paralelo optimizado a partir de un modelo visual de la aplicación. ! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 3!
  • 4. 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 4!
  • 5. Introduction! •  The use of a traditional language to develop parallel programs is not that simple. This Eclipse plug-in is focused on facilitating teaching/learning techniques and implications of parallel, concurrent and multicore computing. ! •  How to improve the way in which we develop parallel computing?. How can we make this process easier?. Using a development environment which generate parallel textual code having as base a visual model of the system. Event though it canʼt warranty the best parallel solution it can warranty a functional solution.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 5!
  • 6. Introducción! Modelo visual a RdPM para su análisis y optimización! !De la RdPM a pseudocódigo, el cuál será convertido a código fuente para una plataforma particular.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 6!
  • 7. Modelo visual! •  Se utiliza un lenguaje visual donde los programas son construidos mediante iconos, conectores y elementos de texto para crear expresiones multidimensionales.! •  Cada icono en el grafo representa una entidad diferente: estructura de control de flujo, datos o atributos.! •  Existen dos tipos de conectores, los cuales definen dos tipos de flujo: ejecución y control.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 7!
  • 8. Modelo visual! Clasificación de actores:! Secuenciales ! Condicionales ! Ciclos y! Control de flujo! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 8!
  • 9. Validación! •  El flujo de ejecución se analiza al momento de interconectar los elementos empleando análisis incremental.! •  Se garantiza que los elementos sean correctos y que estén conectados de forma correcta en todo momento.! •  El flujo de control está conformado por iconos de control (semáforos, candados, et al) y conectores.! •  Se aplica el método de reachability tree a la RdP para garantizar que es correcta y se aplican técnicas de fusión para reducir el modelo.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 9!
  • 10. Validación! El modelo visual es transformado a una RdP.! La RdP representa la ejecución (tanto secuencial como concurrente) y el flujo de control (sincronización, semáforos, candados, etc.)! La RdP define el modelo formal del sistema.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 10!
  • 11. Validación! !Si la RdP satisface las características de alcanzabilidad y vivacidad, el modelo es correcto.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 11!
  • 12. Optimización! El modelo formal puede ser optimizado. La optimización ! incluye:! •  Analizar la dependencia de datos. Para esto se utiliza el grafo subjacente a la RdP. Se intenta asegurar la disponibilidad de datos en cada nodo así cuidar los accesos concurrentes a datos compartidos. ! •  Añadir iconos de control. Analizar la dependencia de datos permite identificar la necesidad de elementos de control como apoyo al cuidado de los accesos concurrentes a datos compartidos.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 12!
  • 13. Optimización! •  Reducción de secuencias y fusión.! El número máximo de hilos a generar está predefinido.! La reducción del modelo facilita el análisis e impacta en la cantidad de líneas de codigo que se generará. Las propiedades de seguridad, alcanzabilidad y vivacidad se conservan. 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 13!
  • 14. Optimización! !For a N value given in a node, it is establish a parallel cyclic structure that allows to chunk a task.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 14!
  • 15. Results! •  Code generation! •  Once we have the Petri net and weʼd optimized that net, we could transform it into a base code. Using this base code we would obtain the final code.! •  Base code or pseudo code consists on a textual expression of the MPN of the system. ! •  Model projection: the textual representation of actors and trajectories are mapped to a programming language using parallel and multicore libraries to a pre-established architecture: distributed system, parallel system or multicore system.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 15!
  • 16. Results! !MPN structure with all its data in places and transitions is converted into a plain text (pseudo-code file), this file is distributed in scenarios and each scenario is divided in five code zones: global data, modules, actors and control and execution flow specifications. ! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 16!
  • 17. Results! !Zones distribution at the file of the resultant source code. ! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 17!
  • 18. Conclusion! •  This visual plug-in allows:! •  An easiest design and a better way to check for grammatical errors.! •  To validate your system through a formal tool.! •  To generate standard, ordered and reliable code.! •  Parallelism optimization. Even though this parallelism optimization could be limited by semantics, it is a good approach which will increase the systemsʼ performance according with Amdahl law.! 01/02/2008! Javier González Sánchez y Maria Elena Chavez Echeagaray ! 18!