<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hello,</div><div><br></div><div>As parallel_run is using child Scilab processes, the std output of all children is the terminal where you started Scilab and not the Scilab console.</div><div><br></div><div>S.</div><div><br>Le 22 oct. 2016 à 15:11, <a href="mailto:paul.carrico@free.fr">paul.carrico@free.fr</a> a écrit :<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Thanks claus</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">I completely forgot this features (that I've ever tested but once only)</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">The first trial "works" if I focus only on the results, but as one can see on the screenshot, a part of the message appears in the console and the second one in the terminal (why ????).</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">The code is the following one for my very basic exemple (I used 2 CPU's here because of my laptop features)</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Paul</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">######################################################################################</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">
<pre><span>mode</span><span>(</span><span>0</span><span>)</span>

<span>function</span> <span>status</span><span>=</span><span>test</span><span>(</span><span>i</span><span>, </span><span>t</span><span>)</span>
    <span>printf</span><span>(</span><span>"</span><span>function %d is launched with a pause of %g second(s)\n</span><span>"</span><span>,</span><span>i</span><span>,</span><span>t</span><span>)</span><span>;</span>
    <span>sleep</span><span>(</span><span>t</span><span>*</span><span>1000</span><span>)</span><span>;</span>
    <span>printf</span><span>(</span><span>"</span><span>function %d is endeed\n\n</span><span>"</span><span>,</span><span>i</span><span>)</span><span>;</span>
    <span>status</span> <span>=</span> <span>0</span><span>;</span>
<span>endfunction</span>

<span>// the duration is expressed in second(s)</span>
<span>//status = test(1,1);</span>
<span>//status = test(2,3);</span>
<span>//status = test(3,5);</span>
<span>//status = test(4,7);</span>

<span>number</span> <span>=</span> <span>[</span><span>1</span> <span>2</span><span>]</span>
<span>duration</span> <span>=</span> <span>[</span><span>1</span> <span>3</span><span>]</span>
<span>status</span> <span>=</span> <span>parallel_run</span><span>(</span><span>number</span><span>,</span><span>duration</span><span>,</span><span>"</span><span>test</span><span>"</span><span>)</span></pre>
</div>
</div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace"> </div>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Le 2016-10-22 10:26, Claus Futtrup a écrit :
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Hi Paul<br> <br> Have you/he/she looked into parallel_run() ?<br> <br> Best regards,<br> Claus<br> <br> On 22-10-2016 09:33, <a href="mailto:paul.carrico@free.fr">paul.carrico@free.fr</a> wrote:<br> <br>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Hi All<br> <br> Maybe my previous email was unclear, but the example hereafter<br> summarizes what I would like to do :<br> - here function is launched when the previous is finished<br> ("sequential way"),<br> - it is possible to launch them simultaneously?<br> <br> _Nb_: I'm currently on Scilab 5.5.4 and maybe only the latest beta<br> release  allows this ?<br> <br> If I can do this, then "bingo"<br> <br> Thanks<br> <br> Paul<br> ---------------------------------------------------------------<br> <br> mode(0)<br> <br> function status=test(i, t)<br> printf("function %d is launched\n",i);<br> sleep(t*1000);<br> printf("function %d is endeed\n\n",i);<br> status = 0;<br> endfunction<br> <br> // the duration is expressed in second(s)<br> status = test(1,1);<br> status = test(2,3);<br> status = test(3,5);<br> status = test(4,7);<br> <br> -------------------------<br> <br> DE: "Paul Carrico" <<a href="mailto:paul.carrico@esterline.com">paul.carrico@esterline.com</a>><br> À: "International users mailing list for Scilab.<br> (<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>)" <<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>><br> ENVOYÉ: Jeudi 20 Octobre 2016 15:41:18<br> OBJET: [Scilab-users] scilab and "parallelization" objectives<br> <br> Dear All,<br> <br> My internship had an interesting request and I’m not able to<br> answer to him   JJ<br> <br> The context is the following one:<br> <br> -          We are using a parallel finite element solver on 4<br> PROCESSORS (under Linux),<br> <br> -          We are performing optimization with an external<br> optimizer,<br> <br> -          Scilab has been interfaced with both the optimizer and<br> the solver,<br> <br> -          For the moment, the optimization loops are<br> “basically” performed using the parallelization capabilities of<br> the solvers.<br> <br> In practice, Scilab “runs” the solver and “waits” the end of<br> the simulation (always using 4 processors) before calculating the<br> cost function value, giving the later value to the optimizer and<br> then closing.<br> <br> IMAGINE THAT NOW we would like to run 4 DIFFERENT SIMULATIONS EACH<br> ON 1 PROCESSOR in order to determine the gain (CPU time) … how to<br> proceed ?<br> <br> In practice Scilab must be able to :<br> <br> -          Launch 1rst calculation and to handback …<br> <br> -          … to launch the 2nd one … and so on<br> <br> We can imagine creating a function per calculation (and I prefer in<br> order to mix stuffs), then running independently but at the same<br> time the different functions.<br> <br> Honestly I’ve never done this before and I’m wondering how to<br> proceed … or if it is possible : any feedback on it ?<br> <br> Thanks and regards<br> <br> Paul<br> <br> EXPORT CONTROL :<br> Cet email ne contient pas de données techniques<br> This email does not contain technical data<br> <br> _______________________________________________<br> users mailing list<br> <a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br> <a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noreferrer">http://lists.scilab.org/mailman/listinfo/users</a><br> <br> _______________________________________________<br> users mailing list<br> <a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br> <a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noreferrer">http://lists.scilab.org/mailman/listinfo/users</a></blockquote>
_______________________________________________<br> users mailing list<br> <a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br> <a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank" rel="noreferrer">http://lists.scilab.org/mailman/listinfo/users</a></blockquote>
</div>

</div></blockquote><blockquote type="cite"><div><screenshot.jpg></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>users mailing list</span><br><span><a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a></span><br><span><a href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a></span><br></div></blockquote></body></html>