Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Case study: Conversione di una applicazione Fortran di dinamica molecolare – Part II<br />Marco Parenzan<br />GPU@UniTS<br />
Source Conversionfrom Fortran to C#<br />Marco Parenzan<br />GPU@UniTS<br />
Writing Good Code<br />Marco Parenzan<br />GPU@UniTS<br />
The original code<br />Original code can be downloaded from http://www.fisica.uniud.it/~ercolessi/md/f90/<br />(C) 1995 Fu...
Problems...<br />High Coupling<br />No replace<br />No Separation of concerns<br />I/O (Data Access), Screen (Presentation...
What is New ?<br />Team development<br />Complex UI<br />Data Access<br />Relational Databases<br />LAN, Internet, Network...
GPUs....<br />GPUs require a lot of preparation code<br />GPUs preparation is a lot specific for the specific card<br />A ...
Modern Coding...<br />Use Object Orientation<br />Identify Concepts<br />Model Concepts into Classes and instantiate them ...
Look at code<br />Linguaggi di programmazione e compilatori per le GPU<br />
CONCLUSIONS – part II<br />Linguaggi di programmazione e compilatori per le GPU<br />
Conclusions<br />All of this are pre-requisites to good code development<br />Objective<br />Create good code<br />Good co...
Molecular simulation<br />Our C# code is quite «elegant» code<br />Good to maintain<br />It’s easy to understand and to id...
Links<br />Marco Parenzan<br />http://blog.codeisvalue.com/<br />marco.parenzan@libero.it<br />http://www.codeisvalue.com/...
Upcoming SlideShare
Loading in …5
×

2011.02.18 marco parenzan - case study. conversione di una applicazione fortran di dinamica molecolare - part ii

920 views

Published on

Fortran Molecular Dynamic Simulation code conversion in C#

  • Be the first to comment

  • Be the first to like this

2011.02.18 marco parenzan - case study. conversione di una applicazione fortran di dinamica molecolare - part ii

  1. 1. Case study: Conversione di una applicazione Fortran di dinamica molecolare – Part II<br />Marco Parenzan<br />GPU@UniTS<br />
  2. 2. Source Conversionfrom Fortran to C#<br />Marco Parenzan<br />GPU@UniTS<br />
  3. 3. Writing Good Code<br />Marco Parenzan<br />GPU@UniTS<br />
  4. 4. The original code<br />Original code can be downloaded from http://www.fisica.uniud.it/~ercolessi/md/f90/<br />(C) 1995 Furio Ercolessi – SISSA<br />Written in Fortran 90<br />Details<br />Typical imperative programming of the ‘80s<br />Fortran primitives<br />Vectors<br />Float<br />No object orientation<br />Code + I/O + user interface mixed in code<br />Single module<br />
  5. 5. Problems...<br />High Coupling<br />No replace<br />No Separation of concerns<br />I/O (Data Access), Screen (Presentation), Calculation (Business Logic)<br />Low reuse<br />Big blocks of code <br />Vertical, for specific use, <br />Low maintability<br />If I change something here, what happens there..?<br />
  6. 6. What is New ?<br />Team development<br />Complex UI<br />Data Access<br />Relational Databases<br />LAN, Internet, Networks<br />Scaling (up and out)<br />...<br />
  7. 7. GPUs....<br />GPUs require a lot of preparation code<br />GPUs preparation is a lot specific for the specific card<br />A lot of Hardware<br />Hardware change<br />Separate code for specific hardware from generic, independent code<br />
  8. 8. Modern Coding...<br />Use Object Orientation<br />Identify Concepts<br />Model Concepts into Classes and instantiate them into Objects<br />Organize Code<br />Use modules (it depends on language of your choise)<br />Organize modules in roles<br />Roles<br />What a module do?<br />I/O<br />Calculation<br />Presentation<br />They are called tiers, if you distribute roles in different machines<br />Create libraries of reusable tools<br />Use modern IDE and Development environments<br />
  9. 9. Look at code<br />Linguaggi di programmazione e compilatori per le GPU<br />
  10. 10. CONCLUSIONS – part II<br />Linguaggi di programmazione e compilatori per le GPU<br />
  11. 11. Conclusions<br />All of this are pre-requisites to good code development<br />Objective<br />Create good code<br />Good code=Maintainable code<br />Sunstainable Development<br />Good code is a big candidate to be performant code<br />If not, the process to become performant code is clean<br />It’s not true about the opposite:<br />Optimal code (for perfomance) probably is not maintainable code<br />...and it’s difficult to get back<br />The money you save making simulation fast, you loose money in updating software<br />What about our code?<br />
  12. 12. Molecular simulation<br />Our C# code is quite «elegant» code<br />Good to maintain<br />It’s easy to understand and to identify code to be ported to GPU<br />Some extreme chooses (all is an object) are not the best for performances<br />Again, best for maintainability<br />GPU primitives are more confident to arrays that to objects<br />But you still remain with the host code<br />Probably the biggest part of the application (in terms of #lines of code)<br />GPU is the best solution in performance<br />But it’s not the only solution<br />«ManyCore» and «Cloud», for example, are not GPU technologies<br />They likes objects...<br />
  13. 13. Links<br />Marco Parenzan<br />http://blog.codeisvalue.com/<br />marco.parenzan@libero.it<br />http://www.codeisvalue.com/<br />@marco_parenzan<br />http://www.slideshare.com/marco.parenzan<br />http://www.facebook.com/parenzan.marco<br />http://it.linkedin.com/in/marcoparenzan<br />

×