<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><span style="font-size: 12pt;">Hi All</span><div style="font-size: 12pt;"><br></div><div style="font-size: 12pt;">Maybe my previous email was unclear, but the example hereafter summarizes what I would like to do :</div><div style="font-size: 12pt;">- here function is launched when the previous is finished ("sequential way"),</div><div style="font-size: 12pt;">- it is possible to launch them <span style="font-family: Arial; font-size: 12px; text-indent: -12px; background-color: rgb(255, 255, 255);"><span style="font-size: 14px; cursor: url("http://cdn2.reverso.net/lexi/v1810/static/img/CM.cur"), auto;"><span id="ID0EKB" direction="targettarget" style="cursor: url("http://cdn2.reverso.net/lexi/v1810/static/img/CM.cur"), auto;">simultaneously?</span></span></span></div><div style="font-size: 12pt;"><br></div><div style="font-size: 12pt;"><i><u>Nb</u></i>: I'm currently on Scilab 5.5.4 and maybe only the latest beta release allows this ?</div><div style="font-size: 12pt;"><br></div><div style="font-size: 12pt;">If I can do this, then "bingo" </div><div style="font-size: 12pt;"><br></div><div style="font-size: 12pt;">Thanks</div><div style="font-size: 12pt;"><br></div><div style="font-size: 12pt;">Paul</div><div style="font-size: 12pt;">---------------------------------------------------------------</div><div><pre style="font-family: Monospaced;"><font size="4"><span style="color: rgb(50, 185, 185);">mode</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">0</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(176, 24, 19);">function</span> <span style="color: rgb(131, 67, 16);">status</span><span style="color: rgb(92, 92, 92);">=</span><span style="text-decoration: underline;">test</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(131, 67, 16);">i</span>, <span style="color: rgb(131, 67, 16);">t</span><span style="color: rgb(74, 85, 219);">)</span>
<span style="color: rgb(50, 185, 185);">printf</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">function %d is launched\n</span><span style="color: rgb(188, 143, 143);">"</span>,<span style="color: rgb(131, 67, 16);">i</span><span style="color: rgb(74, 85, 219);">)</span>;
<span style="color: rgb(50, 185, 185);">sleep</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(131, 67, 16);">t</span><span style="color: rgb(92, 92, 92);">*</span><span style="color: rgb(188, 143, 143);">1000</span><span style="color: rgb(74, 85, 219);">)</span>;
<span style="color: rgb(50, 185, 185);">printf</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">"</span><span style="color: rgb(188, 143, 143);">function %d is endeed\n\n</span><span style="color: rgb(188, 143, 143);">"</span>,<span style="color: rgb(131, 67, 16);">i</span><span style="color: rgb(74, 85, 219);">)</span>;
<span style="color: rgb(131, 67, 16);">status</span> <span style="color: rgb(92, 92, 92);">=</span> <span style="color: rgb(188, 143, 143);">0</span>;
<span style="color: rgb(176, 24, 19);">endfunction</span>
<span style="color: rgb(100, 174, 100);">// the duration is expressed in second(s)</span>
status <span style="color: rgb(92, 92, 92);">=</span> <span style="text-decoration: underline;">test</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">1</span>,<span style="color: rgb(188, 143, 143);">1</span><span style="color: rgb(74, 85, 219);">)</span>;
status <span style="color: rgb(92, 92, 92);">=</span> <span style="text-decoration: underline;">test</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">2</span>,<span style="color: rgb(188, 143, 143);">3</span><span style="color: rgb(74, 85, 219);">)</span>;
status <span style="color: rgb(92, 92, 92);">=</span> <span style="text-decoration: underline;">test</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">3</span>,<span style="color: rgb(188, 143, 143);">5</span><span style="color: rgb(74, 85, 219);">)</span>;
status <span style="color: rgb(92, 92, 92);">=</span> <span style="text-decoration: underline;">test</span><span style="color: rgb(74, 85, 219);">(</span><span style="color: rgb(188, 143, 143);">4</span>,<span style="color: rgb(188, 143, 143);">7</span><span style="color: rgb(74, 85, 219);">)</span>;</font></pre><br><hr id="zwchr" style="font-size: 12pt;"><div style="font-size: 12pt; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif;"><b>De: </b>"Paul Carrico" <paul.carrico@esterline.com><br><b>À: </b>"International users mailing list for Scilab. (users@lists.scilab.org)" <users@lists.scilab.org><br><b>Envoyé: </b>Jeudi 20 Octobre 2016 15:41:18<br><b>Objet: </b>[Scilab-users] scilab and "parallelization" objectives<br><br>
<style><!--
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
@list l0
{mso-list-id:69740802;
mso-list-type:hybrid;
mso-list-template-ids:1207464598 391016768 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l0:level1
{mso-level-start-at:13;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style>
<div class="WordSection1">
<p class="MsoNormal">Dear All,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span lang="EN-US">My internship had an interesting request and I’m not able to answer to him </span><span lang="EN-US" style="font-family:Wingdings">JJ</span><span lang="EN-US"></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">The context is the following one:</span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><span lang="EN-US">We are using a parallel finite element solver on
<b><u>4 processors</u></b> (under Linux),</span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><span lang="EN-US">We are performing optimization with an external optimizer,</span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><span lang="EN-US">Scilab has been interfaced with both the optimizer and the solver,</span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><span lang="EN-US">For the moment, the optimization loops are “basically” performed using the parallelization capabilities of the solvers.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">In practice, Scilab “runs” the solver and “waits” the end of the simulation (always using 4 processors) before calculating the cost function value, giving the later value to the optimizer and then closing.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><b><u><span lang="EN-US">Imagine that now</span></u></b><span lang="EN-US"> we would like to run
<b><u>4 different simulations each on 1 processor</u></b> in order to determine the gain (CPU time) … how to proceed ?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">In practice Scilab must be able to :</span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><span lang="EN-US">Launch 1rst calculation and to handback …</span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><span lang="EN-US">… to launch the 2<sup>nd</sup> one … and so on</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">We can imagine creating <u>a function per calculation
</u>(and I prefer in order to mix stuffs), then running independently but at the same time the different functions.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Honestly I’ve never done this before and I’m wondering how to proceed … or if it is possible : any feedback on it ?</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks and regards</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Paul</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"></p>
<p><b><i><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:gray">EXPORT CONTROL :
<br>
</span></i></b><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:black">Cet email ne contient pas de données techniques<br>
This email does not contain technical data</span></b></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
</div>
<br>_______________________________________________<br>users mailing list<br>users@lists.scilab.org<br>http://lists.scilab.org/mailman/listinfo/users<br></div><br></div></div></body></html>