<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Monospaced;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
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";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"Préformaté HTML Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.PrformatHTMLCar
        {mso-style-name:"Préformaté HTML Car";
        mso-style-priority:99;
        mso-style-link:"Préformaté HTML";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks Stephane for the help.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It works now<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">NB</span></u></i><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">: I changed n to 1000 and num
 to 1E6 (i.e. close to my need) and the speed up is nearly 7 (=7 time faster) </span>
<span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Paul<o:p></o:p></span></p>
<p class="MsoNormal"><o:p></o:p></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"">Cet email ne contient pas de données techniques<br>
This email does not contain technical data</span></b><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> users [mailto:users-bounces@lists.scilab.org]
<b>De la part de</b> Stéphane Mottelet<br>
<b>Envoyé :</b> mardi 14 juin 2016 10:18<br>
<b>À :</b> Users mailing list for Scilab<br>
<b>Objet :</b> [EXTERNAL] Re: [Scilab-users] issue with parallel_run<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<br>
<br>
1-parallel_run is designed to cope with input-output data organized in columns<br>
2-you have to precise the size of the output of yout fct() function.<br>
<br>
Here is your corrected script (with comments) :<o:p></o:p></p>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">mode</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">0</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">clear</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#B01813">function</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><b><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#834310">random_matrix</span></b><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><u><span style="font-size:12.0pt;font-family:"Monospaced","serif"">fct</span></u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><b><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#834310">n</span></b><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">    M </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">grand</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><b><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#834310">n</span></b><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">12</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">'unf'</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">-</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">    M </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">gsort</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">M,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">"lr"</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">"d"</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">    </span><b><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#834310">random_matrix</span></b><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> M</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#FFAA00">:</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">'</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">; // transpose the output<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">    </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">clear</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">M</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#B01813">endfunction</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">num </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">10</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">n </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1000</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><i><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#64AE64">// classical calculation</span></i><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">Result </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">zeros</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">12</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,num</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">; // swap the dimensions<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#AE5CB0">tic</span></u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">()</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#A020F0">for</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> i </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#FFAA00">:</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> num<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">    Result</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#FFAA00">:</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,i</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> <u>fct</u></span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">n</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#A020F0">end</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">disp</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">Result</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">time1 </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#AE5CB0">toc</span></u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">()</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">; </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">printf</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">"time 1 = %g\n"</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,time1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><i><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#64AE64">// using parallel_run</span></i><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p> </o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">Result2 </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">zeros</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">num,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">12</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">vect_n </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> n</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">*</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">ones</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,num</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#AE5CB0">tic</span></u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">()</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""><o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">Result2 </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">parallel_run</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">vect_n, <u>fct</u>,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">[</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">12</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">])</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">; // precise size of output<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">disp</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">Result2</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<pre><span style="font-size:12.0pt;font-family:"Monospaced","serif"">time2 </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-size:12.0pt;font-family:"Monospaced","serif""> </span><u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#AE5CB0">toc</span></u><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">()</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">; </span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#32B9B9">printf</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:rosybrown">"time 2 = %g\n"</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">,time2</span><span style="font-size:12.0pt;font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-size:12.0pt;font-family:"Monospaced","serif"">;<o:p></o:p></span></pre>
<p class="MsoNormal"><br>
<br>
S.<br>
<br>
<br>
Le 14/06/2016 à 10:06, Carrico, Paul a écrit :<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">mode</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">0</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">clear</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#B01813">function</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><b><span lang="EN-US" style="font-family:"Monospaced","serif";color:#834310">random_matrix</span></b><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><u><span lang="EN-US" style="font-family:"Monospaced","serif"">fct</span></u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><b><span lang="EN-US" style="font-family:"Monospaced","serif";color:#834310">n</span></b><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">   
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">    M
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">grand</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><b><span lang="EN-US" style="font-family:"Monospaced","serif";color:#834310">n</span></b><span lang="EN-US" style="font-family:"Monospaced","serif"">,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">12</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">'unf'</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">-</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">1</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">1</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">    M
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">gsort</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">M,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">"lr"</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">"d"</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">   
</span><b><span lang="EN-US" style="font-family:"Monospaced","serif";color:#834310">random_matrix</span></b><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif""> M</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">1</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#FFAA00">:</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">   
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">    </span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">clear</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">M</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">   
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#B01813">endfunction</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">num
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">10</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">n
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">1000</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i><span lang="EN-US" style="font-family:"Monospaced","serif";color:#64AE64">// classical calculation</span></i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">Result
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">zeros</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">num,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">12</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#AE5CB0">tic</span></u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">()</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#A020F0">for</span><span lang="EN-US" style="font-family:"Monospaced","serif""> i
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">1</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#FFAA00">:</span><span lang="EN-US" style="font-family:"Monospaced","serif""> num</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">    Result</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">i,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#FFAA00">:</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
<u>fct</u></span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">n</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#A020F0">end</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">disp</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">Result</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">time1
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#AE5CB0">toc</span></u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">()</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">printf</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">"time
 1 = %g\n"</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,time1</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i><span lang="EN-US" style="font-family:"Monospaced","serif";color:#64AE64">// using parallel_run</span></i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">Result2
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">zeros</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">num,</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">12</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Monospaced","serif"">vect_n
</span><span style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span style="font-family:"Monospaced","serif""> n</span><span style="font-family:"Monospaced","serif";color:#5C5C5C">*</span><span style="font-family:"Monospaced","serif";color:#32B9B9">ones</span><span style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span style="font-family:"Monospaced","serif";color:rosybrown">1</span><span style="font-family:"Monospaced","serif"">,num</span><span style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span style="font-family:"Monospaced","serif"">;
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Monospaced","serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#AE5CB0">tic</span></u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">()</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">Result2
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">parallel_run</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">vect_n,
<u>fct</u></span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif";color:#32B9B9">disp</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif"">Result2</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-family:"Monospaced","serif"">time2
</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#5C5C5C">=</span><span lang="EN-US" style="font-family:"Monospaced","serif"">
</span><u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#AE5CB0">toc</span></u><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">()</span><span lang="EN-US" style="font-family:"Monospaced","serif"">; rintf</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">(</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:rosybrown">"time
 2 = %g\n"</span><span lang="EN-US" style="font-family:"Monospaced","serif"">,time2</span><span lang="EN-US" style="font-family:"Monospaced","serif";color:#4A55DB">)</span><span lang="EN-US" style="font-family:"Monospaced","serif"">;</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
<p><o:p> </o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>Département de Génie Informatique<o:p></o:p></pre>
<pre>EA 4297 Transformations Intégrées de la Matière Renouvelable<o:p></o:p></pre>
<pre>Université de Technologie de Compiègne -  CS 60319<o:p></o:p></pre>
<pre>60203 Compiègne cedex<o:p></o:p></pre>
</div>
</body>
</html>