[Scilab-users] scilab and "parallelization" objectives

Stéphane Mottelet stephane.mottelet at utc.fr
Sat Oct 22 16:33:22 CEST 2016


Hello,

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.

S.

> Le 22 oct. 2016 à 15:11, paul.carrico at free.fr a écrit :
> 
> Thanks claus
>  
> I completely forgot this features (that I've ever tested but once only)
>  
> 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 ????).
>  
> The code is the following one for my very basic exemple (I used 2 CPU's here because of my laptop features)
>  
> Paul
>  
> ######################################################################################
> mode(0)
> 
> function status=test(i, t)
>     printf("function %d is launched with a pause of %g second(s)\n",i,t);
>     sleep(t*1000);
>     printf("function %d is endeed\n\n",i);
>     status = 0;
> endfunction
> 
> // the duration is expressed in second(s)
> //status = test(1,1);
> //status = test(2,3);
> //status = test(3,5);
> //status = test(4,7);
> 
> number = [1 2]
> duration = [1 3]
> status = parallel_run(number,duration,"test")
>  
> Le 2016-10-22 10:26, Claus Futtrup a écrit :
>> 
>> Hi Paul
>> 
>> Have you/he/she looked into parallel_run() ?
>> 
>> Best regards,
>> Claus
>> 
>> On 22-10-2016 09:33, paul.carrico at free.fr wrote:
>> 
>>> Hi All
>>> 
>>> Maybe my previous email was unclear, but the example hereafter
>>> summarizes what I would like to do :
>>> - here function is launched when the previous is finished
>>> ("sequential way"),
>>> - it is possible to launch them simultaneously?
>>> 
>>> _Nb_: I'm currently on Scilab 5.5.4 and maybe only the latest beta
>>> release  allows this ?
>>> 
>>> If I can do this, then "bingo"
>>> 
>>> Thanks
>>> 
>>> Paul
>>> ---------------------------------------------------------------
>>> 
>>> mode(0)
>>> 
>>> function status=test(i, t)
>>> printf("function %d is launched\n",i);
>>> sleep(t*1000);
>>> printf("function %d is endeed\n\n",i);
>>> status = 0;
>>> endfunction
>>> 
>>> // the duration is expressed in second(s)
>>> status = test(1,1);
>>> status = test(2,3);
>>> status = test(3,5);
>>> status = test(4,7);
>>> 
>>> -------------------------
>>> 
>>> DE: "Paul Carrico" <paul.carrico at esterline.com>
>>> À: "International users mailing list for Scilab.
>>> (users at lists.scilab.org)" <users at lists.scilab.org>
>>> ENVOYÉ: Jeudi 20 Octobre 2016 15:41:18
>>> OBJET: [Scilab-users] scilab and "parallelization" objectives
>>> 
>>> Dear All,
>>> 
>>> My internship had an interesting request and I’m not able to
>>> answer to him   JJ
>>> 
>>> The context is the following one:
>>> 
>>> -          We are using a parallel finite element solver on 4
>>> PROCESSORS (under Linux),
>>> 
>>> -          We are performing optimization with an external
>>> optimizer,
>>> 
>>> -          Scilab has been interfaced with both the optimizer and
>>> the solver,
>>> 
>>> -          For the moment, the optimization loops are
>>> “basically” performed using the parallelization capabilities of
>>> the solvers.
>>> 
>>> 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.
>>> 
>>> IMAGINE THAT NOW we would like to run 4 DIFFERENT SIMULATIONS EACH
>>> ON 1 PROCESSOR in order to determine the gain (CPU time) … how to
>>> proceed ?
>>> 
>>> In practice Scilab must be able to :
>>> 
>>> -          Launch 1rst calculation and to handback …
>>> 
>>> -          … to launch the 2nd one … and so on
>>> 
>>> We can imagine creating a function per calculation (and I prefer in
>>> order to mix stuffs), then running independently but at the same
>>> time the different functions.
>>> 
>>> Honestly I’ve never done this before and I’m wondering how to
>>> proceed … or if it is possible : any feedback on it ?
>>> 
>>> Thanks and regards
>>> 
>>> Paul
>>> 
>>> EXPORT CONTROL :
>>> Cet email ne contient pas de données techniques
>>> This email does not contain technical data
>>> 
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>> 
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
> <screenshot.jpg>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161022/7e869afe/attachment.htm>


More information about the users mailing list