Unverified Commit 370dbb38 authored by Guillaume Anciaux's avatar Guillaume Anciaux
Browse files

adding the first lecture

parent 817b2234
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>talk slides</title>
<!-- Loading the init_reveal macro -->
<!-- Load and configure reveal -->
<script src="js-markdown-extra.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!-- General and theme style sheets -->
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/simple.css" id="theme">
<!-- Loading the mathjax macro -->
<!-- Load mathjax -->
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<!-- MathJax configuration -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true,
processEnvironments: true
},
// Center justify equations in code and markdown cells. Elsewhere
// we use CSS to left justify single line equations in code cells.
displayAlign: 'center',
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 0}},
linebreaks: { automatic: true }
}
});
</script>
<!-- End of mathjax configuration -->
<!-- Get Font-awesome from cdn -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css">
<!-- End of reveal parts -->
<style type="text/css">
.reveal {
font-size: 16px;
}
.reveal h1 {
font-size: 200%;
}
.reveal h2 {
font-size: 150%;
}
.text_cell_render {
text-align: left;
}
a.anchor-link:link {
text-decoration: none;
visibility: hidden;
}
.slide {
}
div.slide{
border-style: solid;
border-width: 2px;
/* display: flex;*/
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
margin-top: 5px;
margin-bottom: 5px;
padding-left: 100px;
padding-right: 100px;
padding-top: 2px;
padding-bottom: 2px;
width: 1000px;
}
/*******************************
** highing tpart
*******************************/
.highlight_text {
color: blue;
}
.highlight-base {
color: #000;
}
.highlight-variable {
color: #000;
}
.highlight-variable-2 {
color: #1a1a1a;
}
.highlight-variable-3 {
color: #333333;
}
.highlight-string {
color: #BA2121;
}
.highlight-comment {
color: #408080;
font-style: italic;
}
.highlight-number {
color: #080;
}
.highlight-atom {
color: #88F;
}
.highlight-keyword {
color: #008000;
font-weight: bold;
}
.highlight-builtin {
color: #008000;
}
.highlight-error {
color: #f00;
}
.highlight-operator {
color: #AA22FF;
font-weight: bold;
}
.highlight-meta {
color: #AA22FF;
}
.highlight-def {
color: #00f;
}
.highlight-string-2 {
color: #f50;
}
.highlight-qualifier {
color: #555;
}
.highlight-bracket {
color: #997;
}
.highlight-tag {
color: #170;
}
.highlight-attribute {
color: #00c;
}
.highlight-header {
color: blue;
}
.highlight-quote {
color: #090;
}
.highlight-link {
color: #00c;
}
.highlight .hll { background-color: #ffffcc }
//.highlight { background: #f8f8f8; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #7D9029 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #666666 } /* Literal.Number.Bin */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sa { color: #BA2121 } /* Literal.String.Affix */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0000FF } /* Name.Function.Magic */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .vm { color: #19177C } /* Name.Variable.Magic */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1><center> Scientific Programming <br> for Engineers (SP4E) </center></h1>
<center><img width="75%" src="figures/phd-comics-sp4e.png"></center>
</div>
</div></div>
</section></section><section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="-Welcome-"><center> Welcome </center><a class="anchor-link" href="#-Welcome-">&#182;</a></h1><ul>
<li>About the class<ul>
<li>The goal is to provide some useful knowledge (tool box) to the job of a PhD student who wants to perform a numerical work</li>
<li>Uncover the details of computers and numerical simulations: bring power (analogy blue/red pill of Matrix movie)</li>
<li>The class will be a bit particular (uncovering knowledge), thus it is personal and needs participation.</li>
<li>Students have to build their own understanding/experience on the various tasks required.</li>
<li>Evaluation will be made by evaluating homeworks.</li>
</ul>
</li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="Difficulties-in-making-scientific-software">Difficulties in making scientific software<a class="anchor-link" href="#Difficulties-in-making-scientific-software">&#182;</a></h2>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<ul>
<li>Real numbers (and all rounding errors)<ul>
<li>Overflow and catastrophic cancellation</li>
<li><a href="http://ta.twi.tudelft.nl/users/vuik/wi211/disasters.html">Famous disaster about patriot missiles</a></li>
</ul>
</li>
<li>Units<ul>
<li>Conversion of units to be able to plug modules together</li>
<li>Non SI unit system needs explicit conversion between quantities</li>
<li><a href="https://en.wikipedia.org/wiki/Mars_Climate_Orbiter">Mars Orbiter disaster</a></li>
</ul>
</li>
<li><p>Rapid changes</p>
<ul>
<li>Need of quick and easy implementation/insertion of new features</li>
<li>Need non regression tests</li>
</ul>
</li>
<li><p>Large problems</p>
<ul>
<li>Need to manipulate large number of DOFs to increase accuracy</li>
<li>Need for collaborative tools to make cutting edge applications</li>
</ul>
</li>
</ul>
</div>
</div></div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h4 id="--&quot;Computer-scientists-are/should-be-LAZY-(but-smartly)&quot;--"><em> <center> "Computer scientists are/should be LAZY (but smartly)" </center> </em><a class="anchor-link" href="#--&quot;Computer-scientists-are/should-be-LAZY-(but-smartly)&quot;--">&#182;</a></h4>
</div>
</div><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<center><img src="figures/automation.png"> <br></center>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<center><img src="figures/is_it_worth_the_time.png"></center>
</div>
</div></div>
</section></section><section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="-Cycles-for-engineering-production-of-scientific-software-"><center> Cycles for engineering production of scientific software </center><a class="anchor-link" href="#-Cycles-for-engineering-production-of-scientific-software-">&#182;</a></h2>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<ol>
<li>Scientific question</li>
<li>Analysis and formulation of the problem</li>
<li>Conception: algorithmic decision</li>
<li>Implementation</li>
<li>Deployment of the code</li>
<li>Analysis/post-treatment of the results</li>
</ol>
</div>
</div></div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="-Scientific-question-"><center> Scientific question </center><a class="anchor-link" href="#-Scientific-question-">&#182;</a></h3>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="-Analysis-and-formulation-of-the-problem-"><center> Analysis and formulation of the problem </center><a class="anchor-link" href="#-Analysis-and-formulation-of-the-problem-">&#182;</a></h3><ul>
<li>Math formulation: PDE, optimization, statistical, ...</li>
<li>Define the input and output of the model</li>
<li>Separate the post-treatment</li>
<li>If there are some analytical solutions you need to be aware</li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="-Conception:-algorithmic-decision-"><center> Conception: algorithmic decision </center><a class="anchor-link" href="#-Conception:-algorithmic-decision-">&#182;</a></h3><ul>
<li>Make a chart diagram of the algorithm: separate the subparts</li>
<li>Choose/identify how to solve the subparts</li>
<li>Choose the appropriate data structures</li>
<li>For new algorithms, evaluate the complexity, make an effort of generalization</li>
<li>If global complexity unaffordable with the desired grain (number of DOFs) consider changing the model (back to 2:formulation )</li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="-Implementation-"><center> Implementation </center><a class="anchor-link" href="#-Implementation-">&#182;</a></h3><ul>
<li>Identify existing software for the entire project and for the subparts</li>
<li>Decide a programming language</li>
<li>Decide a coding convention (question of style)</li>
<li>Decide where the code is hosted (for backups and revisions)</li>
<li>Decide a source documentation format</li>
<li>Program the thing</li>
<li>Setup of tests for each necessary sub-part (during programming)</li>
<li>Debug and check for memory leaks</li>
<li>The programming feasibility could here lead to change algorithms or model (back to 2:formulation or 3:conception)</li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="-Deployment-of-the-code-"><center> Deployment of the code </center><a class="anchor-link" href="#-Deployment-of-the-code-">&#182;</a></h3><ul>
<li>Identify the target machine</li>
<li>Fix compilation issues (multi-system, portability, architecture CPU vs. GPU)</li>
<li>Parametric study management (scripting the launch)</li>
<li>Computing shared/cluster of resources: queue system management</li>
<li>Compilation issue, version issues, could lead to implementation change (back to 4:implementation)</li>
<li>Specific hardware could invalidate the algorithmic decision (back to 3:conception)</li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h3 id="-Analysis/post-treatment-of-the-results-"><center> Analysis/post-treatment of the results </center><a class="anchor-link" href="#-Analysis/post-treatment-of-the-results-">&#182;</a></h3><ul>
<li>Sorting/treating the output</li>
<li>Compute digested measures for the brute output (this should be faster than the computation itself otherwise back to 2:formulation)</li>
<li>Produce graphs (for papers and presentations)</li>
<li>3D vizualization</li>
<li>Validate numerical results, stability, coherence, comparison to experiment</li>
<li>If the validation fail get back to 5,4,3 or 2 is possible</li>
</ul>
</div>
</div></div>
</section></section><section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="-The-method-for-this-class-"><center> The method for this class </center><a class="anchor-link" href="#-The-method-for-this-class-">&#182;</a></h1><ul>
<li>Computer place: Your laptop<ul>
<li>Linux as main OS, Dualboot, or on a VMware(need a internet connection)</li>
<li>Python framework</li>
<li>C++ framework</li>
</ul>
</li>
</ul>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<ul>
<li>Open source philosophy $\Rightarrow$ access to source<ul>
<li>Possibility to check the content of the code</li>
<li>Possibility to modify the code for your own purpose</li>
<li>Power of the community</li>
<li>Business model based on knowledge rather than license</li>
</ul>
</li>
</ul>
</div>
</div></div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="-The-method-for-this-class-"><center> The method for this class </center><a class="anchor-link" href="#-The-method-for-this-class-">&#182;</a></h1><ul>
<li>Why C++ and in python<ul>
<li>Object oriented is a way to organize the programs for re-usability</li>
<li>C++ allows objects and efficiency</li>
<li>Python allows interactivity and quick testing</li>
</ul>
</li>
</ul>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<ul>
<li>On the repositories<ul>
<li>Program = bug</li>
<li>Since programs can be complex we need a tool to tag source revisions</li>
<li>Collaborative tool to software development</li>
<li>cvs, svn, git. There is a git at EPFL that we will use.</li>
</ul>
</li>
</ul>
</div>
</div></div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="-The-method-for-this-class-"><center> The method for this class </center><a class="anchor-link" href="#-The-method-for-this-class-">&#182;</a></h1><ul>
<li>On post-treatment programs<ul>
<li>Python is perfect for manipulating files, for parsing outputs, for making graphs</li>
<li>Many program exists for visualization. An opensource one: Paraview</li>
</ul>
</li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="-Books-as-support-for-the-course-"><center> Books as support for the course </center><a class="anchor-link" href="#-Books-as-support-for-the-course-">&#182;</a></h1><ul>
<li><a href="http://en.wikibooks.org/wiki/C++_Programming">C++ wikibook</a></li>
<li><a href="http://en.wikibooks.org/wiki/Python_Programming">python wikibook</a></li>
<li><a href="http://www.amazon.fr/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">Design Patterns. Elements of Reusable Object-Oriented Software</a></li>
<li><a href="http://www.amazon.com/Object-Oriented-Analysis-Design-Applications-Edition/dp/020189551X">Object-oriented analysis and design with applications</a></li>
<li><a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref\%3Dsr_1_1_ha?s\%3Dbooks&amp;ie\%3DUTF8&amp;qid\%3D1410775932&amp;sr\%3D1-1&amp;keywords\%3Dclean\%2Bcode">Clean code</a></li>
<li><a href="http://www.amazon.com/Parallel-Scientific-Computing-MPI-Implementation/dp/0521520800">Parallel scientific computing in c++ and mpi: a seamless approach</a></li>
</ul>
</div>
</div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="Previous-student-evaluations">Previous student evaluations<a class="anchor-link" href="#Previous-student-evaluations">&#182;</a></h1>
</div>
</div><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="(-)">(-)<a class="anchor-link" href="#(-)">&#182;</a></h2><ul>
<li>The pace is too fast. [...] However, I think content covered is important and should not be reduced</li>
<li>[...] considering the programming level of the students attending the course, I think that they get overloaded with too much information</li>
</ul>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<center><img width="30%" src="figures/learning-curve-sp4e.png"></center>
</div>
</div></div></div>
</section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="Previous-student-evaluations">Previous student evaluations<a class="anchor-link" href="#Previous-student-evaluations">&#182;</a></h1>
</div>
</div><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="(-)">(-)<a class="anchor-link" href="#(-)">&#182;</a></h2><ul>
<li>Specific distributions, environments and package versions to work with are rarely specified. Hence, students must spend a significant amount of time figuring out version issues, package incompatibilities...</li>
</ul>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<p><font color="red"> We have prepared the class material for LINUX</font></p>
</div>
</div></div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="(+)">(+)<a class="anchor-link" href="#(+)">&#182;</a></h2><ul>
<li>This was honestly one of the best courses I have ever had. The Professor and the assistants are all very knowledgeable about the course material and make a lot of effort to answer all our questions both in class and on the forum and at any time</li>
</ul>
</div>
</div></div></div>
</section></section><section><section>
<div class="slide" style="float: left"><div class="full" style="width: 100%; float: left">
<div class="text_cell_render border-box-sizing rendered_html">
<h1 id="-Class-plan-description-"><center> Class plan description </center><a class="anchor-link" href="#-Class-plan-description-">&#182;</a></h1>
</div>
</div><div class="fragment" style="width: 100%;float: left"><div class="full" style="width: 100%; float: left">
<div class="cell border-box-sizing code_cell rendered">
<div class="output_area">
<div class="output_markdown rendered_html output_subarea output_execute_result">
<ul>
<li>Thursday 17-th Sep: Introduction, GIT, python hello world</li>
<li>Thursday 24-th Sep: Computer, compilation, C++, floating point numbers</li>
<li>Thursday 01-th Oct: C++ STL</li>